Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Do While loop in VBA
#1
Description:

The Do While loop repeats a block of code as long as a condition is true.

Example:

Sub ExampleDoWhileLoop()
    Dim i As Integer
    i = 1

    Do While i <= 5
        MsgBox "Iteration: " & i
        i = i + 1
    Loop
End Sub
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Loop through columns and clear contents Qomplainerz 0 251 07-27-2023, 11:21 AM
Last Post: Qomplainerz
  Loop through worksheets and print their names in the immediate window Qomplainerz 0 267 07-27-2023, 09:42 AM
Last Post: Qomplainerz
  Loop to fill numbers in cells with VBA Qomplainerz 0 234 07-27-2023, 08:16 AM
Last Post: Qomplainerz
  Loop to display numbers in VBA Qomplainerz 0 233 07-27-2023, 07:33 AM
Last Post: Qomplainerz
  Do Until loop in VBA Qomplainerz 0 182 07-26-2023, 08:34 PM
Last Post: Qomplainerz
  For...Next loop in VBA Qomplainerz 0 213 07-26-2023, 08:32 PM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 1 Guest(s)