Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Using specifieds in a range

Hello, Again,

I am using

D = .Range("G2").Value
E = .Range("H2").Value

to give me two cell references (as values from the cells G2 and H2) which i
then want to use to form a range by something like

..Range(A:B).value
but this doesn't work so is obviously wrong, can anyone help,

thanks

Andy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Using specifieds in a range



in addition, yes i have jus realised i left out the"" but this is bringing
up an error when i run the macro,
..Range ("A1:R4") & .Range("D:E").Select

where D and E are as previous and A1 to R4 is a seperate range
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using specifieds in a range

.Range(D & ":" & E).Value

--
Regards,
Tom Ogilvy

"Momo" wrote in message
...
Hello, Again,

I am using

D = .Range("G2").Value
E = .Range("H2").Value

to give me two cell references (as values from the cells G2 and H2) which

i
then want to use to form a range by something like

.Range(A:B).value
but this doesn't work so is obviously wrong, can anyone help,

thanks

Andy



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Using specifieds in a range

The following works:

Sub test()

D = Range("G2").Value ' Contains A1
E = Range("H2").Value ' Contains B6
Range(D & ":" & E).Select ' Range("A1:B6") is selected

End Sub

HTH

"Momo" wrote:



in addition, yes i have jus realised i left out the"" but this is bringing
up an error when i run the macro,
.Range ("A1:R4") & .Range("D:E").Select

where D and E are as previous and A1 to R4 is a seperate range

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
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
Range.Find returns cell outside of range when range set to single cell Frank Jones Excel Programming 12 June 10th 04 04:22 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


All times are GMT +1. The time now is 09:54 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"