willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 915
- Office Version
- 365
- Platform
- Windows
Hello,
I am requiring help with the below formula:
After data is filtered this code is run and it will select the first cell after the headers and then select every cell that is visible below and copy the data. The problem is Column 10 (J) may have blank cells in between the last cell with data in that column (see picture)
In this section of the code: Range(Selection, Selection.End(xlDown)).Select - is there a way to modify this that instead of going to Selection.End based on column 10 that it does does it based on the last row of data visible in column 1(A)?
I tried something like this but I am missing something:
Thank you to anyone who could help
Carla
I am requiring help with the below formula:
VBA Code:
Sheets("Log").Select
Columns(10).Cells.SpecialCells(xlCellTypeVisible).Cells(2).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
After data is filtered this code is run and it will select the first cell after the headers and then select every cell that is visible below and copy the data. The problem is Column 10 (J) may have blank cells in between the last cell with data in that column (see picture)
In this section of the code: Range(Selection, Selection.End(xlDown)).Select - is there a way to modify this that instead of going to Selection.End based on column 10 that it does does it based on the last row of data visible in column 1(A)?
I tried something like this but I am missing something:
VBA Code:
Sheets("Log").Select
LastRowColumnA = Cells(Rows.Count, 1).End(xlUp).Row
Columns(10).Cells.SpecialCells(xlCellTypeVisible).Cells(2).Select
Range(Selection, LastRowColumnA).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Thank you to anyone who could help
Carla