Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am having a devil of a time trying to find out how to use Range.Select (or something else) with rows and columns that vary. row1 = x1 row2 = x2 col1 = y1 col2 = y2 x1=1 x2=2 y1=1 y2=2 Range(R[x1]C[y1]:R[x2]C[y2]).Select or Range(R[x1]C[y1+1]:R[x1]C[y2+2]).Select is what I am trying to accomplish but I keep getting errors. How do I use the Range statement (or something else) in the above statements? Lance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
Sub test() x1 = 1 x2 = 2 y1 = 1 y2 = 2 Range(Cells(x1, y1), Cells(x2, y2)).Select End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl wrote in message ... Hello, I am having a devil of a time trying to find out how to use Range.Select (or something else) with rows and columns that vary. row1 = x1 row2 = x2 col1 = y1 col2 = y2 x1=1 x2=2 y1=1 y2=2 Range(R[x1]C[y1]:R[x2]C[y2]).Select or Range(R[x1]C[y1+1]:R[x1]C[y2+2]).Select is what I am trying to accomplish but I keep getting errors. How do I use the Range statement (or something else) in the above statements? Lance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Lance,
Range(Cells(x1,y1),Cells(x2,y2)).Select or Range(Cells(x1,y1+1),Cells(x1,y2+2)).Select -- sb wrote in message ... Hello, I am having a devil of a time trying to find out how to use Range.Select (or something else) with rows and columns that vary. row1 = x1 row2 = x2 col1 = y1 col2 = y2 x1=1 x2=2 y1=1 y2=2 Range(R[x1]C[y1]:R[x2]C[y2]).Select or Range(R[x1]C[y1+1]:R[x1]C[y2+2]).Select is what I am trying to accomplish but I keep getting errors. How do I use the Range statement (or something else) in the above statements? Lance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select a variable range | Excel Worksheet Functions | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
Using a variable for range of cells | Excel Discussion (Misc queries) | |||
Use a Variable to select a range | Excel Discussion (Misc queries) | |||
Range("C9:V9").Select ==> changing the 9 to a variable | Excel Worksheet Functions |