Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use the following code below to populate the current cell on the January
worksheet (there is a worksheet for each month, and each month has to have all the names that appear on the ParaTransit Names worksheet) with the name that is entered in the referenced cell on the ParaTransit Names worksheet: =IF('ParaTransit Names'!B15"",'ParaTransit Names'!B15,"") I then use the following code to place the name contained in the active cell on the January worksheet in the TextBox of the UserForm: Private Sub UserForm_Initialize() Dim rng Set rng = Cells(ActiveCell.Row, 1) 'Places date in box at top of userform TextBox1.Text = rng(1, 2).Text End Sub What I was hoping for, is that when I ran the code below it would search out and select the cell matching the TextBox value on the ParaTransit Names worksheet. What I get is an Error Msg "object variable or With block variable not set". Any guidance here? Private Sub CommandButton1_Click() With ActiveWorkbook.Worksheets("ParaTransit Names") Cells.Find(What:=Me.TextBox1.Text, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=True, SearchFormat:=False).Activate End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Runtime Error 91 Object variable or With block variable not set. | Excel Programming | |||
Run-Time error '91': Object variable of With block variable not set | Excel Programming | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |