Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Range References in vba

I have 2 named cells say, tStart and tEnd - If I wanted to set the
contents of all cells within the Range("tStart:tEnd") I thought I could
do something like the following;

Sheet4.Range("tStart:tEnd").Value = "Temp"

but that givs me a '400' type error - what would the way be to reference
these cells.

On a side issue, is it possible to get cell references from a named
cell/Range in some way ?

Thanks for any illumination


Regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Range References in vba

Try

With Sheet4

.Range(.Range("tStart"),.Range("tEnd")).Value = "Temp"
End With

--

HTH

Bob

"Isis" wrote in message
...
I have 2 named cells say, tStart and tEnd - If I wanted to set the
contents of all cells within the Range("tStart:tEnd") I thought I could
do something like the following;

Sheet4.Range("tStart:tEnd").Value = "Temp"

but that givs me a '400' type error - what would the way be to reference
these cells.

On a side issue, is it possible to get cell references from a named
cell/Range in some way ?

Thanks for any illumination


Regards



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 457
Default Range References in vba

Use a comma so seperate the names, not a colon.

Sheet4.Range("tStart","tEnd").Value = "Temp"

--
Best Regards,

Luke M
"Isis" wrote in message
...
I have 2 named cells say, tStart and tEnd - If I wanted to set the
contents of all cells within the Range("tStart:tEnd") I thought I could
do something like the following;

Sheet4.Range("tStart:tEnd").Value = "Temp"

but that givs me a '400' type error - what would the way be to reference
these cells.

On a side issue, is it possible to get cell references from a named
cell/Range in some way ?

Thanks for any illumination


Regards



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Range References in vba

hi
on the side issue, something like this might work
MsgBox Range("tStart:tEnd").Address
or for a range
MsgBox Range("myRange").Address

regards
FSt1

"Isis" wrote:

I have 2 named cells say, tStart and tEnd - If I wanted to set the
contents of all cells within the Range("tStart:tEnd") I thought I could
do something like the following;

Sheet4.Range("tStart:tEnd").Value = "Temp"

but that givs me a '400' type error - what would the way be to reference
these cells.

On a side issue, is it possible to get cell references from a named
cell/Range in some way ?

Thanks for any illumination


Regards
.

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
Offset vs. Range references Howard Kaikow Excel Programming 2 May 5th 08 04:11 PM
Relative range references in VBA - how? mike Excel Programming 1 October 6th 06 03:49 PM
Range references in VB MathCzyk Excel Programming 2 September 26th 06 05:55 PM
How to rename references from range names to cell references Abbas Excel Discussion (Misc queries) 1 May 24th 06 06:18 PM
Column and row references of range Michael Allen Excel Programming 1 July 6th 04 07:54 PM


All times are GMT +1. The time now is 11:16 PM.

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

About Us

"It's about Microsoft Excel"