Hi,
I'm very new to VBA and need some help.
I want to copy the data in a specific range but exclude the rows with cells containing "".
So far I have this code but it selects all cells in the range because some cells contains a formula resulting in empty string "", meaning they are not blank according to Excel.
The macro will be assigned to a Form Control Button located on Sheet 1.
Any help greatly appreciated!
I'm very new to VBA and need some help.
I want to copy the data in a specific range but exclude the rows with cells containing "".
So far I have this code but it selects all cells in the range because some cells contains a formula resulting in empty string "", meaning they are not blank according to Excel.
VBA Code:
Sub CopyData()
Sheets("Sheet2").Select
With Worksheets("Sheet2")
.Range("B2", .Range("AD" & Rows.Count).End(xlUp)).Copy
End With
Sheets("Sheet1").Select
End Sub
The macro will be assigned to a Form Control Button located on Sheet 1.
Any help greatly appreciated!