Variable not set
Hi,
Tobe sure as well, declare thevairalble type
Dim Category as string
Dim Period as string
...
Category = Sheet2.Range("A1").Value & Sheet2.Range("A77").Value
--
Regards
Jean-Yves Tfelt
Europe
"LuisE" wrote:
I have this macro running from a commandbutton in sheet2, it gets a
concatenated string and look it up in sheet24 once found retrieves datum from
sheet24 and shows it in an userform
I'm getting the variable/block not set error for rFound, cFound is working
Thanks in advance
Sub DirectLabor()
Dim Category
Dim Period
Dim Row
Dim Column
Dim Comment
Dim rFound As Range
Dim cFound As Range
Category = Sheet2.Range("A1") & Sheet2.Range("A77")
Period = Sheet2.Range("B3")
With Sheet24
Set rFound = Sheet24.Cells.Find(What:=Category, After:=Sheet24.Cells(1, 1),
LookIn:=xlValues
Row = rFound.Row
Set cFound = Sheet24.Cells.Find(What:=Period, After:=Sheet24.Cells(1, 1),
LookIn:=xlValues
Column = cFound.Column
Comment = Sheet24.Cells(Row, Column).Text
Frm1.Txt.Text = Comment
End With
Frm1.Show
End Sub
|