ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   access a cell by it's name (https://www.excelbanter.com/excel-programming/292229-access-cell-its-name.html)

Simon Sunke

access a cell by it's name
 
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



Andy Wiggins[_3_]

access a cell by it's name
 
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"



"Simon Sunke" wrote in message
...
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





Rob van Gelder[_4_]

access a cell by it's name
 
myvar = Range("my_name").Value

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Simon Sunke" wrote in message
...
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





Bob Phillips[_5_]

access a cell by it's name
 
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)

"Simon Sunke" wrote in message
...
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





Simon Sunke

access a cell by it's name
 
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



Rob van Gelder[_4_]

access a cell by it's name
 
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.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Simon Sunke" wrote in message
...
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






All times are GMT +1. The time now is 08:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com