title: Why the object does not support this method?
body: <p>I have the following code</p>
  <pre><code>Dim Shop1 As String
  With Worksheets(&quot;Data Page&quot;)
  Shop1 = Application.WorksheetFunction.Index(.Range(&quot;B2:B7&quot;), Application.Worksheet.Match(profitable1, .Range(&quot;E2:E7&quot;), 0))
  End With
  </code></pre>
  <p><a href="https://i.stack.imgur.com/si8ha.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/si8ha.png" alt="enter image description here" /></a></p>
  <p>This is how my excel looks like</p>
  <p>The code works at first, but after I change some value,it suddenly does not and the above error pops out.
  Can someone tell me why? Thank you so much for helping</p>