Formerly Best Training
© 2024 STL. All Rights Reserved.
All prices offered for business users and exclude VAT. E&OE
2nd Floor, CA House, 1 Northey Street, Limehouse Basin, London, E14 8BT. United Kingdom
Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA excel
Resolved · Low Priority · Version 2003
Chris has attended:
Excel VBA Intro Intermediate course
Access Introduction course
Access Intermediate course
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.
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
Mon 27 Apr 2009: Automatically marked as resolved.
|
Excel tip:Converting an American date format to European using FormulaExcel depending on your local setting will only pick up date values of the dd mmm yyyy oders as date type. If you import data from various sources including America their date order is different with data value in mmm dd yyyy, excel can only treat it as text indicated by left aligning it. To overcome this you have to do the the following. |
We'll call during UK business hours
Server loaded in 0.07 secs.