Use the WorksheetFunction object MATCH function to locate the column header label in the first row.
Sub FindAddressColumn()
dim cl as long
with worksheets("Sheet1")
if not iserror(application.match("address", .rows(1), 0)) then
cl = application.match("address", .rows(1), 0)
.range(.cells(2, cl), .cells(rows.count, cl).end(xlup)).select
else
MsgBox "Address column was not found."
Exit Sub
end if
end with
End Sub
I prefer to look from the bottom up to find the last populated cell in a column but if you prefer to look from the top down, the above code could be easily modified to suit.
The Range .Select¹ method is not always the most reliable method of referencing individual or groups of Range objects. Directly referencing the parent worksheet with a With ... End With statement should help.
¹ See How to avoid using Select in Excel VBA macros for more methods on getting away from relying on select and activate to accomplish your goals.