Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
multiple selection
Help me please,
I need make a multiple selection in VBA but vith variable. My example which works: range("A1:A2, C1:C2").select I need something like: value = 2 range("A1:A & value, C1:C & value").select but it does not work, would you help me? thanx Michal |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
multiple selection
Michal,
You're close. Try the following: Dim Value As Long Value = 2 Range("A1:A" & Value & ",C1:C" & Value).Select -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Michalll" wrote in message om... Help me please, I need make a multiple selection in VBA but vith variable. My example which works: range("A1:A2, C1:C2").select I need something like: value = 2 range("A1:A & value, C1:C & value").select but it does not work, would you help me? thanx Michal |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
multiple selection
one way:
Dim myValue As Long myValue = 2 Range("A1:A" & myValue & ",C1:C" & myValue).Select (it's better not to use VBA keywords, like Value as variable names - it can get very confusing) In article , (Michalll) wrote: Help me please, I need make a multiple selection in VBA but vith variable. My example which works: range("A1:A2, C1:C2").select I need something like: value = 2 range("A1:A & value, C1:C & value").select but it does not work, would you help me? thanx Michal |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
multiple selection
If you don't like working with strings, perhaps another option might be
something like this... n = 2 Intersect([A1,C1,E1,G1].EntireColumn, Rows(1).Resize(n)).Select -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "Michalll" wrote in message om... Help me please, I need make a multiple selection in VBA but vith variable. My example which works: range("A1:A2, C1:C2").select I need something like: value = 2 range("A1:A & value, C1:C & value").select but it does not work, would you help me? thanx Michal |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple selection criteria | Excel Worksheet Functions | |||
Multiple Selection Combo Box | Excel Discussion (Misc queries) | |||
multiple selection | Excel Discussion (Misc queries) | |||
multiple selection.... | Excel Worksheet Functions | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) |