Tejas Kore
Board Regular
- Joined
- Nov 2, 2017
- Messages
- 72
- Office Version
- 365
- Platform
- Windows
Hi Friends,
I am bit confused as this keyword("continue") exits or not in VBA. Then after googling I found this link
https://docs.microsoft.com/en-us/dotnet/visual-basic/language.../continue-statement
Here they have mentioned the use of this keyword. But when I tried to implement that it is giving error.
Here in the below code I have used [MsgBox ("Skipping")].Here I actually want to skip the iteration.
How can I achieve this ?
Sub test()
names1 = Array("Fox", "Elephant", "Rat")
For Each strsearch In names1
If strsearch Like "*an*" Then
MsgBox ("Skipping") 'Want to go to next iteration
Else
MsgBox (strsearch)
End If
Next strsearch
End Sub
I am bit confused as this keyword("continue") exits or not in VBA. Then after googling I found this link
https://docs.microsoft.com/en-us/dotnet/visual-basic/language.../continue-statement
Here they have mentioned the use of this keyword. But when I tried to implement that it is giving error.
Here in the below code I have used [MsgBox ("Skipping")].Here I actually want to skip the iteration.
How can I achieve this ?
Sub test()
names1 = Array("Fox", "Elephant", "Rat")
For Each strsearch In names1
If strsearch Like "*an*" Then
MsgBox ("Skipping") 'Want to go to next iteration
Else
MsgBox (strsearch)
End If
Next strsearch
End Sub