Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I checked lots of posts but have not been able to find a solution for my looping problem. Hope someone can help. I have 8 comboboxes on a worksheet sheet and I want to reset the listindex on each one to 0. Here's the code I used: Application.ScreenUpdating = False Dim sheetname As String Dim sFormName As String Dim a As Byte Dim b As Byte sheetname = ActiveSheet.Name For a = 1 To 8 Set sFormName = "combobox" & a Worksheets(sheetname).sFormName.ListIndex = 0 Next a When I run the code I get "run-time error '91'" which states that "Object variable or with Block variable not set" This occurs when its starts to run the for loop. Can anyone tell me what I'm doing wrong? AJ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Looping through different comboboxes in an excel sheet | Excel Programming | |||
Looping through all comboboxes in workbook and setting values with .additem | Excel Programming | |||
ActiveX comboboxes on worksheet (lost focus problems) | Excel Programming | |||
Looping through ComboBoxes in a worksheet | Excel Programming | |||
Control ComboBoxes & Worksheet Protection | Excel Programming |