ECON10151 Lecture 6 Introduction to Visual Basic for Applications (VBA)Matlab

Java Python ECON10151 Lecture 6

Introduction to Visual Basic for Applications (VBA)

Nov 2024

Learning Outcomes

•  Be able to implement custom VBA functions within Excel to perform complex calculations

•  Be able to understand and apply VBA loop structures, allowing them to automate repetitive calculations across datasets

Introduction

This lecture introduces students to the power of Excel VBA as a tool for automating calculations and efficiently handling repetitive tasks in data processing. We will start with creating a custom VBA function, which allows us to perform complex calculations that Excel’s built-in functions might not support directly.  Building on this, we’ll explore how to use VBA loops to extend these functions across multiple rows, automating the calculation for an entire dataset in just a few steps. Writing the code yourself is not a requirement for this course; however, it is more important to understand the code and its meaning.

1 Set Up

The Visual Basic editor is located under the Developer tab. However, the Developer tab is not displayed in the Excel ribbon by default, but you can easily add it to access VBA editor.

•  For Windows Users

1.  Click on the File tab.

2.  Select Options.

3.  In the Excel Options window, choose Customise Ribbon.

4.  In the Customise the Ribbon section, locate the Main Tabs list and check the box next to Developer.

5.  Click OK to apply the changes.

• For Mac Users

1.  Click on Excel in the top menu.

2.  Preferences.

3.  Choose Ribbon & Toolbar.

4.  the Customise the Ribbon section, find the Main Tabs list and check the box next to Developer.

5.  Click Save to confirm the changes.

2 Introduction to Visual Basic for Applications (VBA)

Visual  Basic for Applications  (VBA)  is a programming  language developed by  Microsoft that  is embedded within  Excel and other Office applications.  VBA enables users to automate repetitive tasks, enhance data analysis, and create custom functions and solutions tailored to specificneeds.

Overview of VBA Editor

The V

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值