![]() We’re going to use the following test data for the code examples in this post: The If statement is used to check a value and then to perform a task based on the results of that check. The important word in the last sentence is check. As you read through each student you would use the If Statement to check the marks of each student. ![]() You will often want to make choices based on the data your macros reads.įor example, you may want to read only the students who have marks greater than 70. The VBA If statement is used to allow your code to make choices when it is running. ( Note: Website members have access to the full webinar archive.) Members of the Webinar Archives can access the webinar for this article by clicking on the image below. If value 5 Then Debug.Print "Value is greater than five." ElseIf Sheet1.Range( "A1").Value < 5 Then Debug.Print "value is less than five." Else Debug.Print "value is equal to five." End If Quick Guide to the VBA If Statement Description 10 Using Logical Operators with the VBA If Statement.8 Using ElseIf with the VBA If Statement.7 Using Conditions with the VBA If Statement.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |