We can also write this line like this Sheet1.Range( "A1").Value = 5
MACRO EXCEL CODE
Let’s look at the line of code we used in the previous section of this VBA Tutorial Sheet1.Range( "A1") = 5 You should see “Some text” in cells B1, 5.55 in the cells C3 to E5 and the current time and date in the cell F1. Add each of the following lines to your sub, run the sub and check the results.Note: If you don’t place the cursor in the sub, VBA will display a list of available subs to run. Select Run->Run Sub/Userform from the menu(or press F5). Click in the sub to ensure the cursor is placed there.You have created a sub! Let’s take it for a test drive. We place our code between these two lines. VBA will automatically add the second line End Sub.Enter the following line in the code window and press enter.Make sure the name is visible in the title bar.
Copy values from one range of cells to another.Copy the value from one cell to another.Understand the difference between a module and sub.When you finish this VBA tutorial you will be able to: 15 Conclusion of the VBA Tutorial Part One.12.3 Writing between variables and cells.11 Copying values between multiple cells.3 Basic Terms Used in this VBA Tutorial.2 The Six Killer Tips For This VBA Tutorial.
1 Learning Outcomes for this VBA Tutorial.