Wookiee
Active Member
- Joined
- Nov 27, 2012
- Messages
- 402
- Office Version
-
- 365
- 2019
- Platform
-
- Windows
I have a bit of code I'm working on that loops through a defined number of columns and should change the value in every cell in Column A which is stored in an odd-numbered row. But when I tried to use the MOD function in VBA, I get a run-time error (object doesn't support this property or method). I could not find a VBA equivalent of the worksheet formula MOD, so I'm at a loss for how to proceed.
Here's my code:
Can anyone offer a suggestion or workaround?
Many thanks!
Here's my code:
Code:
For lngLastRow = 2 To 29150
If WorksheetFunction.Mod(lngLastRow, 2) = 1 Then Range("A" & lngLastRow) = "Hello, world"
Next lngLastRow
Can anyone offer a suggestion or workaround?
Many thanks!