ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find value and adress (https://www.excelbanter.com/excel-programming/288892-find-value-adress.html)

acces[_6_]

Find value and adress
 
Hi,

I have a large list of entries...In column A there is Date...Then I
have UserForm with Calendar. After selecting Date in form, I'd like to
find address of cell in column A with selected Date...

Why following doesn't work, required Date isn't found...

With Worksheets(1).Range("A:A")
Set c = .Find(Calendar1.Value)
If Not c Is Nothing Then
firstaddress = c.Address
' Do something
Else
' Do something else
End If

End With

Any help will be useful...
Thanks.


---
Message posted from http://www.ExcelForum.com/


Bob Phillips[_6_]

Find value and adress
 
This is just a guess as I don't use the calendar control myself.

Could it be that the value from calendar is only returned when you click on
a cell, and that afterwards, calendar.value is empty? If so, you would need
to save when clicking it, and then use that saved value to find the
corresponding value in A.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"acces " wrote in message
...
Hi,

I have a large list of entries...In column A there is Date...Then I
have UserForm with Calendar. After selecting Date in form, I'd like to
find address of cell in column A with selected Date...

Why following doesn't work, required Date isn't found...

With Worksheets(1).Range("A:A")
Set c = .Find(Calendar1.Value)
If Not c Is Nothing Then
firstaddress = c.Address
' Do something
Else
' Do something else
End If

End With

Any help will be useful...
Thanks.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 08:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com