How do I get the last column address

mecerrato

Board Regular
Joined
Oct 5, 2015
Messages
174
Office Version
  1. 365
Platform
  1. Windows
I am using the following code to get the last column number but I am trying to get he last column address. So if the last column is 5 then the result I am looking for is "F"
VBA Code:
Sub LastColumnInOneRow()
    Dim LastCol As Integer
    With Sheets("Current Pipeline")
        LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
    End With
    MsgBox LastCol
End Sub
 
No, it is not. Over the years, we have seen many people "carpet bomb" multiple Excel sites with the same question at the same time.
When asked, they usually say that they wanted an answer "as fast as possible".

As we stated, we don't have an issue with it, as long as you follow the guidelines set forth (and note that most other sites have similar rules).
It is really just about having consideration for volunteers time. If a question has already been solved elsewhere, it is helpful to know so as not to waste our time (or even if it is not solved, to not suggest something else that someone has already suggested elsewhere).


Yes, it is spelled out quite clearly in the rules 13 of the rules link we referenced earlier: Message Board Rules
Thanks for your direction, this is 2nd nature to you but I am a novice coder so not as familiar as you are. Thank you for spelling it out so clearly to us novice coders, your services are greatly appreciated
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You are welcome.

Going forward, as long as you mention it and includes the links to those other posts, there shouldn't be any issues.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top