access a cell by it's name

S

Simon Sunke

Hello

I need to access a certain cell in a worksheet, but I don't know the
coordinates (row,col => because it may be moved when inserting rows or
cols).
So I tried to name that cell, but now I don't know how to access that named
cell from the macro code.

Can anybody help me?
Thanks!
Simon Sunke
 
A

Andy Wiggins

If you named the cell "QQQ", then in VBA:

Sub a()

Range("QQQ") = 123

MsgBox Range("QQQ")

End Sub

--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"
 
B

Bob Phillips

Hi Simon,

Try something like

MsgBox Range("myrange").Value

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
S

Simon Sunke

Hey thanks a lot to all of you...

works great with the Range Object.

Is there any good tutorial on the web where I could have found that answer
(to stop bugging you with such questions in the future...)

Simon
 
R

Rob van Gelder

Try Google Groups.
It's pretty good to search back through old articles.
Pair this with Excel's Help and you've got a winning combination.
 
Top