0

I am new to Excel VBA and what I want to do is the following.

enter image description here

Currently the cell "F3" is active, and I would like to know if there is a function that returns the value "F3".

I imagine that there is a way to extract the 'coordinate' of F3 as (6,3) since F is the 6th letter and 3 is simply 3 (maybe (3,6) if it counts row first and columns later).

If it can return something like (F,3) it would be even better, and best case scenario, F (the column LETTER) by itself.

It is imperative that I am able to extract the column letters because I intend to use this as an input to "replace all letter A to letter B".

If you have an exact answer that would be great, but if you could guide me towards a useful link that would be appreciated, too.

Thank you!!

1 Answer 1

2

Try below sub-

Sub GetCellAddress()
Dim x As Variant
    x = Split(ActiveCell.Address, "$")
    MsgBox x(1) & "," & x(2)
End Sub

Result in message box: F,3

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! That was very useful (: So many useful tools in such a small code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.