Chris has attended:
Excel VBA Intro Intermediate course
Access Introduction course
Access Intermediate course
VBA excel
I have multiple text boxes and comboboxes that when completed by a user, i need to have an on-click command that copies each of the values to a row of cells in excel.
Currently I have code for each one. I would prefer to use a loop command.
RE: VBA excel
Hi Chris. I'm going to assume your user changes the values of the objects on the form, and then clicks "OK" and the values are copied to the Excel cells. If your textboxes and comboboxes are numbered squentially you could cycle through each one by changing the value as so:
For MyTextboxNumber = 1 To 10
TextBox[MyTextboxNumber]...
Next n
Alternatively, you can jump from textbox to textbox by looping through the TabIndex value of each object and copying the values to a variable.
Hope this helps,
Anthony