So i was using a for each loop to go through a bunch of rows. I ran into a problem where i was deleting rows and it was causing a row to get skipped so i have changed to a do while loop.
The problem i am having is trying to get a 'cell' object. Before when i had:
For Each C In Worksheets("Blah").Range("A2:A" & lastRow).Cells
I could do things like
C.Offset(1, 0)
C.Value = "Troy"
Etc. I tried using:
C = Worksheets("Blah").Cells(iRow, 2)
but that just gives C the value of the cell. How do i get the actual cell object?
Thanks
To get an object reference and not the value itself you need to use 'Set'
Set C = Worksheets("Blah").Cells(iRow, 2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With