View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Andrew[_56_] Andrew[_56_] is offline
external usenet poster
 
Posts: 130
Default Range Reference Problem

On Oct 18, 12:21*pm, Ron Rosenfeld wrote:
On Tue, 18 Oct 2011 10:49:37 -0700 (PDT), sylink wrote:
I need to convert this range reference to a variable one using "Z" for
only "D4005". "B2" is static and therefore need not be changed.


Dim Z As Integer


Range( "B2:D4005")


I attempted something like this without success:


Range("B2:D & Z & ")


Thank you for your anticipated response.


Not tested:

Try: * Range("B2","D" & Z)

or

* * Range("B2:D" & Z)


Try this:
Range(cells(2,2),cells(4,Z))