helpneeded2
Board Regular
- Joined
- Jun 25, 2021
- Messages
- 110
- Office Version
- 365
- Platform
- Windows
I am trying to create a macro that will look for all rows of continuous data, until it reaches the first row without data, and then copy those rows.
My sheet can have up to 300 rows of data, but will normally only have about 150+. I have created a sheet with formulas for 300 rows, which pulls data in from a raw data sheet with a similar number of columns. If the value in column C of the raw data sheet is blank, then the value in column C of my processing sheet is "", and then all other cells for that row on the processing sheet will also be "".
I am using the current formula, but I think it is detecting the "" as containing data, so it is selecting data from all 300 rows, rather than just the rows that have data other than "".
Can someone please suggest a fix for this:
My sheet can have up to 300 rows of data, but will normally only have about 150+. I have created a sheet with formulas for 300 rows, which pulls data in from a raw data sheet with a similar number of columns. If the value in column C of the raw data sheet is blank, then the value in column C of my processing sheet is "", and then all other cells for that row on the processing sheet will also be "".
I am using the current formula, but I think it is detecting the "" as containing data, so it is selecting data from all 300 rows, rather than just the rows that have data other than "".
Can someone please suggest a fix for this:
VBA Code:
Sub copyAll()
Dim endOfRows As Long
endOfRows = Range("C" & Rows.Count).End(xlUp).Row
Range("B3").Resize(endOfRows - 2, 40).Select
Selection.Copy
End Sub