Just Alter the loop body a bit, i.e. instead of saying Combo & I.value,
write it this way
Me.Controls("ComboBox" & I).AddItem Sheets(I).cells(Index,13).value
Ensure that the number of combobox controls on the form are within the
limits of the loop variable I. Me refers to the Form Object. If the combo is
contained within a frame control, replace the Me with the Frame Control's
name.
Regards,
Ajit
On Thu, Sep 25, 2008 at 11:24 PM, mememe <[EMAIL PROTECTED]> wrote:
>
> I have large number of arrays with matching names apart from the
> integer at the end ie combo!, combo2, combo3, combo4 etc and i need
> to input data into each array from a single sheet with similar names
> sheet1, sheet2, sheet3, sheet4 etc etc.
>
> Now, the number of arrays is over 50 and i would prefer to input data
> into each array using a for loop as in
>
> for i = 1 to 50
>
> combo & i(i,3).value= sheet & i .cells(index,13).value
>
> next i
>
> However, the above code does not work so does anyone have a clue as to
> how i can achieve this, i have to use a for loop as the number of
> arrays and sheets varies lots depending upon the type of data i am
> looking at.and i really do not want pages and pages of the same code
> when a loop can do this.
>
> Thank you
>
>
> >
>
--
Thank You,
Ajit Navre
--~--~---------~--~----~------------~-------~--~----~
Visit the blog to download Excel tutorials at
http://www.excel-macros.blogspot.com
To post to this group, send email to [email protected]
For more options, visit this group at
http://groups.google.com/group/excel-macros?hl=en
Visit & Join Our Orkut Community at
http://www.orkut.com/Community.aspx?cmm=22913620
Visit the blog to download Excel tutorials at
http://www.excel-macros.blogspot.com
To Learn VBA Macros Please visit http://www.vbamacros.blogspot.com
To see the Daily Excel Tips, Go to:
http://exceldailytip.blogspot.com
-~----------~----~----~----~------~----~------~--~---