How can i write a vba code to get string or integer "C15" from $c$15?

D

d

I use Excel VBA function.
I have CELL address : $c$15

How can i write a vba code to get string C15?
 
C

Chip Pearson

I'm not sure exactly what you want, but the Address property will return the
address of a cell or range. E.g.,

Msgbox Range("$C$15").Address(False,False)

See help on Address for more details.
 
T

Tom Ogilvy

sStr = "$C$15"
msgbox range(sStr).Address(external:=True) & vbnewline &
range(sStr).Value

or

maybe you want the address

sStr = Range("C15").Address(0,0)

or to get the value stored in the cell

Dim vVal as Variant
vVal = Range("C15").Value

hopefully you can get what you want from the above examples.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top