doriannjeshi
Active Member
- Joined
- Apr 5, 2015
- Messages
- 338
- Office Version
- 365
- Platform
- Windows
Hi,
This macro wont copy the entire column if there are gaps in the column with no data, will stop copying the rest of the column.
Can it be fixed to copy the whole column ?
Sheets.Add After:=ActiveSheet
Dim vHeader As Variant, rngFound As Range, i As Long
For Each vHeader In Array("EAN/UPC", "demo", "demo", "demo", "demo demo", "demo", "demo", "demo", "demo demo", "demo demo demo", "demo demo", "demo demo", "demo demo")
Set rngFound = Sheets(1).Cells.Find(vHeader, , xlValues, xlWhole, 1, 1, 0)
i = i + 1
If Not rngFound Is Nothing Then
Range(rngFound, rngFound.End(xlDown)).Copy Destination:=Sheets(2).Cells(1, i)
End If
This macro wont copy the entire column if there are gaps in the column with no data, will stop copying the rest of the column.
Can it be fixed to copy the whole column ?
Sheets.Add After:=ActiveSheet
Dim vHeader As Variant, rngFound As Range, i As Long
For Each vHeader In Array("EAN/UPC", "demo", "demo", "demo", "demo demo", "demo", "demo", "demo", "demo demo", "demo demo demo", "demo demo", "demo demo", "demo demo")
Set rngFound = Sheets(1).Cells.Find(vHeader, , xlValues, xlWhole, 1, 1, 0)
i = i + 1
If Not rngFound Is Nothing Then
Range(rngFound, rngFound.End(xlDown)).Copy Destination:=Sheets(2).Cells(1, i)
End If