Possible Duplicate:
Last not empty cell in row; Excel VBA
Finding the number of non-blank columns in an Excel sheet using VBA
Hello I have written a vba code for getting the address of selected cell(active cell). But I want the address of last used columns address,here is the code what i wrote
Dim a As String
a = Split(ActiveCell.Address, "$")(1)
MsgBox a
it is working correctly but i want the address of last used columns. like i have the values upto "AB" columns I want get that address using vba code.