PDA

View Full Version : Solved: Move to next cell



Mandy
07-02-2007, 05:44 AM
hi:hi:

i am writing a code to fill combobox, form data presented in the excelsheet.
suppose a1,a2.......a10 contains 10 different items. currently i am in a1.
value of a1 is added to the combobox.
now how i can move to next cell that is a2 so that i can fill combobox.

Thanks.

unmarkedhelicopter
07-02-2007, 06:04 AM
Dim lnX as long
For lnX = 1 to 10
me.combobox1.additem = worksheets("WorksheetName").cells(lnx,1).value
next lnX

you will have to put "YOUR" worksheet name in for the name given above.

Mandy
07-02-2007, 06:19 AM
:hi: hi
thanks
its working
but with two changes
first as u mentioned change the sheet name
second by removing = sign:rotlaugh:

Thanks:friends:

unmarkedhelicopter
07-02-2007, 07:55 AM
That sometimes happens when you type from memory instead of putting it into Excel first to debug. :)