Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry Sam,
But the result was on Range 1/2/3/4 address is. -- Best Regards, Faraz "Sam Wilson" wrote: sub somethinglikethis() dim l as long dim x as long dim aStr() as string l = Application.InputBox("How Many Ranges?", , , , , , , 1) redim preserve aStr(l) for x = 1 to l aStr(x) = application.InputBox("Select Range " & x) next x for x = 1 to l msgbox "Range " & x & " adress is " & astr(x) next x end sub "Faraz A. Qureshi" wrote: Any idea how to declare multiple variables depending upon the times looping shall be carried on. An idea may be grasped by my unfit CoDe as below: Sub test() Dim Counter As Long Counter = Application.InputBox("How Many Ranges?", , , , , , , 1) For x = 1 To Counter Dim Range & x As range set Range & x = application.InputBox("Select Range " & x) Next For Z = 1 To Counter msgbox "Range "& Z " comprised of " & (Range & Z).address Next End Sub Please help me out by rectifying the above code, or designing a similar code or referring to a site, for which I shall be grateful. Thanx in advance. -- Best Regards, Faraz |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing Variables within For loops to other modules | Excel Programming | |||
Help please! Loops? For Each? Variables? | Excel Programming | |||
Multiple loops one result | Excel Programming | |||
Correct declaration of variables | Excel Programming | |||
Correct declaration of variables | Excel Programming |