Stephen_IV
Well-known Member
- Joined
- Mar 17, 2003
- Messages
- 1,180
- Office Version
- 365
- 2019
- Platform
- Windows
Good morning,
First of all I am not very good at VBA but was trying to exclude values in a loop. For instance this loop will give me a range of 1 to 61. Is there a way to exclude some of the values like take out values 9, 18, 19, 23, 24, 29, 33, 34, 35, 38. I could probably write a delete sub to do this afterwords but is there an easy way or am I missing something? Thanks in advance.
First of all I am not very good at VBA but was trying to exclude values in a loop. For instance this loop will give me a range of 1 to 61. Is there a way to exclude some of the values like take out values 9, 18, 19, 23, 24, 29, 33, 34, 35, 38. I could probably write a delete sub to do this afterwords but is there an easy way or am I missing something? Thanks in advance.
Code:
Sub practice()
Dim i As Integer
For i = 1 To 61
Cells(i, 1) = i
Next
End Sub