share an example sheet for better idea...

atleast 5 instances

+++++
*I did not do this for you. God is here working through me for you.*

On Tue, Dec 2, 2014 at 4:41 PM, Mahesh Patil <zmpa...@gmail.com> wrote:

> Hi Paul,
> Thans for reply.
> I am looking to create variable at runtime.
>
> Ex:
> Sub test()
> Dim X as range
>
> X =Activeworkbook.worksheet("sheet1").range("A1:A100")
>
> For each i in X
> Dim i as integer
> Next i
>
> End sub
>
> 'This code wont work
> ' I need to create 100 variables 'having name mentioned in each 'cell of
> range X.
>
> Pls suggest solution
>
> Regards,
> Mahesh Patil
> On Dec 1, 2014 6:33 PM, "Paul Schreiner" <schreiner_p...@att.net> wrote:
>
>> First of all, it LOOKS like you're wanting to create a two dimensional
>> array.
>> This is "normally" handled by something like:
>>
>> dim arname(3,50)
>>
>> Then, you'd use:
>> arname(0,0) = "country"
>> arname(1, 0) = "state"
>> arname(2, 0) = "city"
>>
>> if you want to change an array size, you use:
>> Redim narray(3,50)
>>
>> HOWEVER, you cannot change an array size for an array fully defined by
>> Dim.
>>
>> So, you'd use:
>> Sub test()
>>     Dim i
>>     Dim arname() As String
>>
>>     ReDim arname(3, 50) As String
>>     arname(0, 0) = "country"
>>     arname(1, 0) = "state"
>>     arname(2, 0) = "city"
>> End Sub
>>
>> your loop:
>> For i= 0 T0 2
>> arname(i) (50) as string
>> Next i
>>
>> would not work, even if you used ReDim properly,
>> since it makes the assumption that each first-level element of the
>> array (i = 0 to 2)
>> could have a diffenent secondary element
>> (which it cannot)
>>
>> hope this helps
>> *Paul*
>> -----------------------------------------
>>
>>
>>
>>
>>
>>
>>
>> *“Do all the good you can,By all the means you can,In all the ways you
>> can,In all the places you can,At all the times you can,To all the people
>> you can,As long as ever you can.” - John Wesley*
>> -----------------------------------------
>>
>>    *From:* Mahesh Patil <zmpa...@gmail.com>
>> *To:* excel-macros@googlegroups.com
>> *Sent:* Monday, December 1, 2014 5:54 AM
>> *Subject:* $$Excel-Macros$$ VBA : How to create array dynamically
>>
>> Hello experts,
>> 'Below code is not working.
>> 'I need to create array of each 'element in arname()
>> ' pls suggest solution
>> ' arname () can have more than 100 'elements.
>> Sub test()
>> Dim arname() as string
>> arname(0) = "country"
>> arname(1) = "state"
>> arname(2) ="city"
>> For i= 0 T0 2
>> arname(i) (50) as string
>> Next i
>> End sub
>>
>> Thanks.
>> Regards,
>> Mahesh Patil
>>  --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>    --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>
> NOTE : Don't ever post confidential data in a workbook. Forum owners and
> members are not responsible for any loss.
> ---
> You received this message because you are subscribed to the Google Groups
> "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to excel-macros+unsubscr...@googlegroups.com.
> To post to this group, send email to excel-macros@googlegroups.com.
> Visit this group at http://groups.google.com/group/excel-macros.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to