Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to select several ranges using a variable (verylastrow) at the
same time to format the items in the selection but I am having a problem. It must be Friday because I cannot figure out the syntax error in the following code: Range("(A1:A & verylastrow), D1:E & verylastrow), (G1:H & verylastrow)").Select I'm sure it is something simple but any help would be appreciated. Thanks. -- JT |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("A1:A" & verylastrow & ",D1:E" & verylastrow _
& ",G1:H" & verylastrow).Select from the immediate window: verylastrow = 10 Range("A1:A" & verylastrow & ",D1:E" & verylastrow _ & ",G1:H" & verylastrow).Select ? SELECTION.ADDRESS $A$1:$A$10,$D$1:$E$10,$G$1:$H$10 -- Regards, Tom Ogilvy "JT" wrote in message ... I'm trying to select several ranges using a variable (verylastrow) at the same time to format the items in the selection but I am having a problem. It must be Friday because I cannot figure out the syntax error in the following code: Range("(A1:A & verylastrow), D1:E & verylastrow), (G1:H & verylastrow)").Select I'm sure it is something simple but any help would be appreciated. Thanks. -- JT |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much. The macro now does exactly what I'm trying to do.
Thanks again and have a good weekend. -- JT "Tom Ogilvy" wrote: Range("A1:A" & verylastrow & ",D1:E" & verylastrow _ & ",G1:H" & verylastrow).Select from the immediate window: verylastrow = 10 Range("A1:A" & verylastrow & ",D1:E" & verylastrow _ & ",G1:H" & verylastrow).Select ? SELECTION.ADDRESS $A$1:$A$10,$D$1:$E$10,$G$1:$H$10 -- Regards, Tom Ogilvy "JT" wrote in message ... I'm trying to select several ranges using a variable (verylastrow) at the same time to format the items in the selection but I am having a problem. It must be Friday because I cannot figure out the syntax error in the following code: Range("(A1:A & verylastrow), D1:E & verylastrow), (G1:H & verylastrow)").Select I'm sure it is something simple but any help would be appreciated. Thanks. -- JT |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
variable not declared error & syntax error | Excel Programming | |||
Syntax Error help | Excel Programming | |||
Syntax error. | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming | |||
Where is my syntax error? | Excel Programming |