Using specifieds in a range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top