Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Newbie to userforms question here.
Setting up a user UserForm for Data entry there are 32 TextBoxes named CAT1BOX, CAT2BOX, CAT3BOX,... CAT32BOX 28 Labels named CAT1, CAT2, CAT3, ... CAT28 I am trying to name and populate them dynamically using the For-Next statement below, but am getting a RunTime error '91 "Object variable or With block variable not set" Private Sub UserForm_Initialize() Dim MyField As Object, MyWork As Object Me.Caption = "WorkFlow Tracking for " & Sheets("Data").Range("B4").Value & _ " For " & Sheets("Data").Range("B3").Value For i = 1 To 32 If i < 29 Then MyField = "CAT" & i MyField.Text = Sheets("data").Range("J17").Offset(-i + 1, 0).Value MyWork = "CAT" & i & "BOX" MyWork.Value = Sheets("data").Range("B12").Offset(0, i - 1).Value Else MyWork = "CAT" & i & "BOX" MyWork.Value = Sheets("data").Range("B12").Offset(0, i - 1).Value End If Next End Sub I know I am not seeing something incrediblly stupid... If anyone knows of an "Idiots guide to using UserForms in Excel" ... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with Userforms | Excel Discussion (Misc queries) | |||
I need some help with userforms | Charts and Charting in Excel | |||
Question - How to group unique objects in Excel | Excel Discussion (Misc queries) | |||
Assigning VB to Grouped Objects | Excel Discussion (Misc queries) | |||
UserForms | Excel Discussion (Misc queries) |