P
Patrick C. Simonds
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
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