Link to home
Start Free TrialLog in
Avatar of Jagwarman
Jagwarman

asked on

vba to find the last non blank cell in a range and then copy

Can an expert provide me with VBA code that will find the last blank cell [starting from the bottom of the sheet] and then copy the range.

i.e. the range is always A:K but the number of rows will vary.

I have tried a couple of ways of doing this but neither work for me.

Range(ActiveCell, Range(ActiveCell.Address).End _
(xlToRight).End(xlDown)).Select

Is only selecting 3 rows and

Range(Range("A1"), Cells.SpecialCells(xlCellTypeLastCell)).Select

Is selecting to the end of the worksheet.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Ken Butters
Ken Butters
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jagwarman
Jagwarman

ASKER

Thanks Ken brilliant