Excel VBA Bootcamp: VBA Programming with Practical Workouts

Recording Macro, Creating Excel VBA form, Fetching data from MS Access, Working with multiple sheets and workbook
4.09 (5939 reviews)
Udemy
platform
English
language
Microsoft
category
Excel VBA Bootcamp: VBA Programming with Practical Workouts
85 402
students
4.5 hours
content
Sep 2024
last update
$19.99
regular price

Why take this course?

为了帮助您理解和实现Excel VBA中的这些工作例子,我将提供一个概览和一些代码片段。以下是您提到的14个工作示例的简要说明和相应的VBA代码或步骤。

Workout Example 01 – Using Forms for User Entry, Chart Display Etc.

  1. 创建并定义VBA表单控件:使用VBA中的UserForm来创建自定义表单,添加文本框、列表框和按钮等控件。
  2. 事件处理:为各种控件定义事件处理程序,例如OnClick, OnChange等。
  3. 数据输入/输出(如果您已知如何在Excel中设置表单及如何在代码中设置):使用Form.Show方法来展示和收藏表形态

Workout Example 02 – Data from MS Access Database into Text File

Dim dbConnection As ADODBConnection
Set dbConnection = CurrentDbReferenceSet
With dbReferenceSet
    '(MSAccessApplication.Name))
    '(DAODBApplication.Path))
'Open Access Database...'

这个示例展示如何从Microsoft Access数据库中读取数据并将其写入一个文本文件。

Workout Example 03 – Insert Excel VBA Form Data into MS Access Database

在Access database, you can use the DAO.DBEngine to perform operations like insert, update, delete, etc. You need to connect to the database first using Connection, then you can manipulate the data as needed.

Workout Example 05 – Reading Complete Worksheet Data into a Table in VBA

Dim wsht As Excel.Worksheet
Set wsht = ActiveWorksheet
With wsht
    'Open Worksheet...'
    'Read Worksheet Data...'

在 the worksheet, you can use the Worksheet.Cells(1, 1) property to read data from a specific cell.

Workout Example 09 – Windows Based User Authentication and Voice Notification of Execution of VBA

使用Windows API来进行用户身份验证。成后 voice notification of VBA code execution.

'Include necessary libraries...'
Public Declar
    Call FunctionFromWindow(ByVal hWnd As LongPtr, ByVal sDictInfo As Window, ByRef wshet As Excel.Worksheet, _
        "Authentication..."
End Public

在 the Windows environment, you can use functions like FunctionFromWindow to perform authentication and then execute your VBA code based on the authenticated user.

Workout Example 10 – Running SQL Command Through VBA

在 VBA, you can run SQL commands using the ExecuteOutstand method.

'Run SQL command...'
Public Sub RunSQLCommand
    'Execute Outstand SQLCommand...'
    'Outstand SQLCommand:'&sqlCommandString
End Sub

在 VBA, you can run SQL commands with advanced syntax and operations.

Workout Example 13 – Recursive File and Folder Size Within a Folder Through VBA

在 VBA, you can write a recursive function to calculate the size of files and folders within a specified folder.

'Recursively Calculate File and Folder Sizes...'
Public Sub RunRecursiveFileAndFolderSizes
    'Initialize objects for file and folder sizes...'
    'Loop through files and folders, calculating size recurssively...'
End Sub

在 VBA, you can iterate through files and folders in a specified folder, calculating the size of each file or folder recursively.

Workout Example 14 – Combine All Files Inside a Folder Through VBA

在 VBA, you can write code to combine multiple files into one data set, with file names and sizes listed.

'Combine Multiple Excel Files into One Data Set...'
Public Sub RunCombineFiles
    'Initialize objects for combining files...'
    'Loop through files, writing combined data to a data set...'
End Sub

在 VBA, you can use functions to combine all files within a specified folder and store the result. 以 these Workout Examples as a guide, you now have a comprehensive understanding of how to implement various tasks in Excel VBA. Each example builds upon the previous one, so make sure you grasp the fundamentals first before moving on to more complex scenarios. Happy Coding!

Course Gallery

Excel VBA Bootcamp: VBA Programming with Practical Workouts – Screenshot 1
Screenshot 1Excel VBA Bootcamp: VBA Programming with Practical Workouts
Excel VBA Bootcamp: VBA Programming with Practical Workouts – Screenshot 2
Screenshot 2Excel VBA Bootcamp: VBA Programming with Practical Workouts
Excel VBA Bootcamp: VBA Programming with Practical Workouts – Screenshot 3
Screenshot 3Excel VBA Bootcamp: VBA Programming with Practical Workouts
Excel VBA Bootcamp: VBA Programming with Practical Workouts – Screenshot 4
Screenshot 4Excel VBA Bootcamp: VBA Programming with Practical Workouts

Loading charts...

Related Topics

1030420
udemy ID
03/12/2016
course created date
06/08/2019
course indexed date
Bot
course submited by