Link to home
Start Free TrialLog in
Avatar of Rayne
RayneFlag for United States of America

asked on

Get the Extreme Left and Right Cell addresses

Hello Everyone,

I am looking for a code that does this. I am tired to manually mentioning the first and the last column header address in all of my functions so need this macro to grab these extreme left – right cell address. Now..
What it does >> it looks at sheet1  - the very first row that has the column names – searches left and right….when it searches left, it grabs c1’ cell address (B3)  - when it searches extreme right, it gets the c9’s cell address and finally give s a msgbox saying :
Left Header Cell : “B3”
Right Header Cell: “J3”

Please note that the first row that has the column names can be at row 3 or any other row…so it has to do some type of search or something
leftrightCells.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Steve
Steve
Flag of United Kingdom of Great Britain and Northern Ireland 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 Norie
Norie

Rayne

How can you tell which row is the row with headings?
What are the extreme left and extreme right headings called? You said the row would vary but would the columns always be the same?
Avatar of Rayne

ASKER

Hello All,

For your excellent feedbacks: I will be opening a second question follow to this and get all other different approaches towards this issue.

The_Barman: Thank your solution works for me. you used used range. I would now want to see if there is nay other approach (s) different from this method.

 
imnorie: How can you tell which row is the row with headings?

The top most row is most likely to be the row with headings - now the top-most row could be on row3 or row 5 or any row

 


techfanatic
 What are the extreme left and extreme right headings called? You said the row would vary but would the columns always be the same?
C1, C9
Actually, the users would be adding in more columns at the end of the table, so the last column will change with time.


I have posted another question for you guys > if you can come up with different approaches to resolve this issue.