title: Object variable or With block variable not set in Find method
body: <p>There is a problem here <code>Set OTc = WS.Range(&quot;c2:dc2&quot;).Find(DateworkTB, lookat:=xlWhole, SearchOrder:=xlByColumns)</code></p>
  <blockquote>
  <p>Run-Time Error 91 Object variable or With block variable not set</p>
  </blockquote>
  <p>I solved many ways, still not solved. Please help.</p>
  <pre><code>Private Sub InputCMBT_Click()
  Dim OTr, OTc As Range
  Dim OTr2, OTc2 As Range
  Dim WS, PCMB
  Set WS = Worksheets(&quot;OT&quot;)
   
      Set OTr = WS.Range(&quot;a3:a36&quot;).Find(Employeecm.Text, lookat:=xlWhole, SearchOrder:=xlByRows)
      MsgBox OTr.Row
      
      Set OTc = WS.Range(&quot;c2:dc2&quot;).Find(DateworkTB, lookat:=xlWhole, SearchOrder:=xlByColumns)
      MsgBox OTc.Column
      
          If WS.Cells(OTr.Row, OTc.Column) = &quot;&quot; Then
              WS.Cells(OTr.Row, OTc.Column) = OvertimeTB.Value
              WS.Cells(OTr.Row, OTc.Column + 2) = ShiftCBB.Text
          Else
              WS.Cells(OTr.Row, OTc.Column).Clear
              WS.Cells(OTr.Row, OTc.Column + 2).Clear
              WS.Cells(OTr.Row, OTc.Column) = OvertimeTB.Value
              WS.Cells(OTr.Row, OTc.Column + 2) = ShiftCBB.Text
          End If
          
              If WS.Cells(OTr.Row, OTc.Column + 2) = &quot;a&quot; And &quot;b&quot; And &quot;c&quot; Then
                  WS.Cells(OTr.Row, OTc.Column + 1) = 7
              ElseIf WS.Cells(OTr.Row, OTc.Column + 2) = &quot;M&quot; And &quot;N&quot; Then
                  WS.Cells(OTr.Row, OTc.Column + 1) = 10.5
              Else
                  WS.Cells(OTr.Row, OTc.Column + 1) = 8
              End If
  End sub
  </code></pre>