I have a sheet with names and other identifying data along the left hand columns and a named range at the top of my sheet showing date information (ie 1-31). And I have named the date range "DateAll"
I've been trying to write a macro that gets the DateAll for specific individuals based on a search for certain identifying criteria.
The problem is that I'm not sure in the future if I will be adding additional information on the individuals, so I need to select the specific row and the columns associated with the specific range, even if the column labels may change in the future.
Here are some things I've tried and failed.
This did work but when I added new columns it failed by selecting two columns too far. I'm also not sure why it worked. I dont know why I had to have (-1, -6) to select the current row...but anyway![]()
LineHours = FirstMatch.Offset(-1, -6).Range("DateAll").Select
Obviously returns an error...![]()
LineHours = FirstMatch.Row.Range("DateAll")
In plain English I would like the code to select the cells related to the column's in range "DateAll" in the Selected cell's row. And I would like it to select that range no matter the number of columns added or removed.
Thanks in advance. I've been banging my head against a wall for a few days now.
Since this has become buried a few pages deep I've cross posted it here:
http://www.mrexcel.com/forum/showthr...43#post2724243
Bookmarks