Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Single cell access FP Novice Excel Discussion (Misc queries) 4 May 27th 08 05:00 PM
how to access a cell value in a different workbook. HELP! [email protected] Excel Worksheet Functions 2 October 18th 06 09:32 PM
can i access the cell colour programatically? eg if cell is blue Tony2Far Excel Discussion (Misc queries) 2 August 9th 06 06:50 PM
how do i set up a link between one excel cell from an access cell Joy A. Excel Discussion (Misc queries) 1 March 14th 06 02:20 AM
Cell access Bob Chandler Excel Programming 3 January 12th 04 02:17 AM


All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"