mmetzinger
Board Regular
- Joined
- Dec 30, 2010
- Messages
- 61
Ok, I know there have been like a billion questions about this but there doesn't seem to be a definitive answer and I have come to Mr. Excel to get it. I am using Office 2010 and am responsible for sorting out this huge census files we get from our customers. My issue is I write one Macro and then generalize it to be used on many different companies.
So to accomplish this I figured out how to find the last row which was easy with:
Dim LastRow as string
LastRow = "A" & Range("A1").End(xlDown).Select
'I just wrote that from memory so it may be a little wrong
But I need to be able to find the last column and store that in a variable that I can call later. What I have found is that you can get a column number with:
Range("A1").End(xlToRight).Select
But I can't figure out how to get the column letter so I can do something like:
Dim LastColumn as string
Lastcolumn = Range("A1").End(xlToRight).Select 'but column letter
My goal is to have it where in operations later I can just give it LastColumn instead of a arbitrary column that I choose myself like CC or something.
Thanks for any help.
So to accomplish this I figured out how to find the last row which was easy with:
Dim LastRow as string
LastRow = "A" & Range("A1").End(xlDown).Select
'I just wrote that from memory so it may be a little wrong
But I need to be able to find the last column and store that in a variable that I can call later. What I have found is that you can get a column number with:
Range("A1").End(xlToRight).Select
But I can't figure out how to get the column letter so I can do something like:
Dim LastColumn as string
Lastcolumn = Range("A1").End(xlToRight).Select 'but column letter
My goal is to have it where in operations later I can just give it LastColumn instead of a arbitrary column that I choose myself like CC or something.
Thanks for any help.