I need to take a snapshot of a sheet and then copy it into a PowerPoint. I have all that working great..
In order to do this, I have to determine how many rows contain data in the current sheet. What I am doing is looping through the rows looking for data in a certain cell. Again, this works but it seems there might be a more efficent way of doing this...
Here is the code I currently have.
I then use iRows as my range of rows to take the snapshot.
Thanks for the help..
In order to do this, I have to determine how many rows contain data in the current sheet. What I am doing is looping through the rows looking for data in a certain cell. Again, this works but it seems there might be a more efficent way of doing this...
Here is the code I currently have.
Code:
iRows = 4 ' start at row 4 to account for heading
Do While iRows < 200 'only count upto 200 rows
If ws.Range("A" & iRows) = "" And ws.Range("C" & iRows) = "" Then
Exit Do
Else
iRows = iRows + 1
End If
Loop
I then use iRows as my range of rows to take the snapshot.
Thanks for the help..