Hi,
I'm new to the forum, usually I've been able to search and find solutions but this time I'm at a loss.
I'm trying to select to the last cell with a value in a non-contiguous column without using a direct column reference. I'm using a downloaded report and sometimes upper management adds or moves columns so I use find to locate the column I want to select.
I want to do essentially what this utility does:
Here is what I have:
However "Range(Selection, Selection.End(xlDown)).Select" stops the first time it finds a blank.
I figure this could be achieved by taking a count of an adjacent column that is always contiguous or using "Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select" and having it count from the start column to the end then back tracking to leave only one column selected. But I haven't had any luck figuring out the proper syntax to achieve this.
Or does someone have another idea on how to achieve this?
If I wasn't really clear please let me know.
Any help would be very appreciated!
Thank you for taking the time to read over this!
I'm new to the forum, usually I've been able to search and find solutions but this time I'm at a loss.
I'm trying to select to the last cell with a value in a non-contiguous column without using a direct column reference. I'm using a downloaded report and sometimes upper management adds or moves columns so I use find to locate the column I want to select.
I want to do essentially what this utility does:
HTML:
http://www.asap-utilities.com/blog/index.php/2013/02/06/tip-quickly-extend-your-selection-down-without-scrolling/
Code:
Sub Format_EIB()
Cells.Find(What:="Ledger Account - Reference ID", After:=ActiveCell, LookIn:=xlValues _
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Select
Selection.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sub Format_EIB()
Cells.Find(What:="Ledger Account - Reference ID", After:=ActiveCell, LookIn:=xlValues _
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Select
Selection.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
I figure this could be achieved by taking a count of an adjacent column that is always contiguous or using "Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select" and having it count from the start column to the end then back tracking to leave only one column selected. But I haven't had any luck figuring out the proper syntax to achieve this.
Or does someone have another idea on how to achieve this?
If I wasn't really clear please let me know.
Any help would be very appreciated!
Thank you for taking the time to read over this!