View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Activate the cell which was found by vlookup formula

Hi Norbert,

Am Thu, 6 May 2021 05:36:29 -0700 (PDT) schrieb Norbert:

I had a similar problem before and I found the code from that time but I still can't figure it out.
I have a date in cell E3 (e.g. "01-05-2021") which also can be found in range H7:H18. That range has all the dates of the 1st day of each month.

I enter the date into cell E3 and then I run a macro. I want the macro to automatically select the particular cell within the range H7:H18, which has the same date as cell E3.


try:

Dim c As Range
Dim myDate As Date

With ActiveSheet
myDate = .Range("E3")
Set c = .Range("H7:H18").Find(myDate, after:=Range("H18"))
If Not c Is Nothing Then Application.Goto c
End With


Regards
Claus B.
--
Windows10
Microsoft 365 for business