View Single Post
  #7  
Old 4th July 2005, 03:43 PM
bluetown bluetown is offline
Member
 
Join Date: May 2005
Posts: 68
Default

Here's a piece of code asked by someone I cannot find answers for, same reason, they (Excel Forum) do not seem to understand racing.

Sub Find_First()
Dim FindString As String
Dim Rng As Range
FindString = InputBox("Enter a Search value")

If Trim(FindString) <> "" Then
Set Rng = Range("A:A").find(What:=FindString, _
After:=Range("A" & Rows.Count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End If
End Sub


I'll try and break it down.

Excel Sheet 1
Cell A1
Has a date always fixed in Sheet1 A1
But in Sheet 2 the same date may not be in Cell A1

They (the experts) say to type in the date where it says:

FindString = InputBox("Enter a Search value")

But that defeats the purpose because it's horse race and the dates keep changing.
The question, how is the code then written to find the fixed value of Sheet 1 A1 and find the same date or Value in Sheet 2 in whatever Cell it exists ?
Without having to type it in.

Is this the type of problems you get Duritz ?
Reply With Quote