|
-
Dec 6th, 2005, 09:14 PM
#1
Thread Starter
Member
Selecting a Range
I'm trying to use the following code
VB Code:
Range("A"&Select1&":BW"Select1&",A8:BW8")
Where Select1 is an integer, But i cant get it to work can anyone help.
Last edited by Pearso; Dec 7th, 2005 at 05:14 PM.
-
Dec 6th, 2005, 11:24 PM
#2
Addicted Member
Re: Selecting a Range
You were missing an Ampersand and the comma should not be in the last range.
VB Code:
Range("A" & Select1 & ":BW" & Select1 , "A8:BW8")
Untested...but it should work
-
Dec 7th, 2005, 12:15 AM
#3
Re: Selecting a Range
 Originally Posted by Pearso
I'm trying to use the following code
VB Code:
Range("A"&Select1&":BW"Select1&",A8:BW8")
Where Select1 is an integer, But i cant get it to work can anyone help.
Hi,
You missed the "&" as marked in blue color font in the following code. And also give space between words, variables, etc. If you want to select that range, you need to use the following code:
VB Code:
Range("A" & select1 & ":BW" [COLOR=Blue]&[/COLOR] select1 & ", A8:BW8").Select
For example, If the value of select1 is 5 it will select "A5 to BW5" and "A8 to BW8".
Always give space between variables, ambersand, strings etc.
________________
CS.
Last edited by cssriraman; Dec 7th, 2005 at 12:20 AM.
-
Dec 7th, 2005, 05:13 PM
#4
Thread Starter
Member
Re: Selecting a Range
Thanks,
It always helps to have a second set of eyes look gs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|