This code finds the first entry for what is in Sheet1 A5, but how do I find the second entry for this search, not the first?
Thanks guys!![]()
Please Login or Register to view this content.
This code finds the first entry for what is in Sheet1 A5, but how do I find the second entry for this search, not the first?
Thanks guys!![]()
Please Login or Register to view this content.
Last edited by excelcandy; 10-15-2013 at 03:43 PM.
Hi Excelcand,
maybe so
![]()
Please Login or Register to view this content.
[CODE]
Sub INeedToSearchForCellValue()
Dim rngFound As Range
Set rngFound = Sheets("Sheet2").Cells.Find(What:=Sheets("Sheet1").Range("A5").Value, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
set rngFound = Findnext(rngFound)
If rngFound Is Nothing Then
MsgBox "No match found. ", , "No Match"
Else
Application.Goto rngFound
End If
End Sub
This isn't working, error on
![]()
Please Login or Register to view this content.
Sorry yeah, forgot to reference the findnext method to a sheet. Nilem's code works fine for me though and is better than mine anyway.
This goes yellow![]()
Please Login or Register to view this content.
I meant to attach a file in which the error occurs
Click on GO ADVANCED and use the paperclip icon to open the upload window.
View Pic
sorry, can't because of work. what could it be?
Is "66B" a named range?
Ok,
works now. How do you search a certain text instead of Cell A5 ?![]()
Please Login or Register to view this content.
thanks
Nilem, pm me your paypal for a small reward![]()
![]()
Please Login or Register to view this content.
maybe LookIn:=xlValues instead of LookIn:=xlFormulas?
or just
![]()
Please Login or Register to view this content.
How do I find the third and fourth entry?
So, if this finds the first occurence and that finds the second time the value occurs,,, what code is needed to find the third and fourth ?????????????????????????????????
First value found:
Second value found:![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
try
![]()
Please Login or Register to view this content.
Hey, that's cool, unfortunately I don't want to count the occurences, but just select the 3rd occurence ( or 4th or 5th or ... occurence), like in the code before
change loop until cnt = 3 as appropriate for the one you want to select.![]()
Please Login or Register to view this content.
or
@yudlugar I hope together we will (shall?) defeat this thread![]()
Please Login or Register to view this content.
![]()
Hey, I just experimented with ma skillz and found out that I just have to double the following line to find the 3rd occurence
![]()
Please Login or Register to view this content.
Last edited by excelcandy; 10-10-2013 at 04:27 PM.
There is a problem with this, guys. If I try to get the occurence of the first, second, third and fourth search, It finds the first occurence every single time if there is only one occurence, not 2,3,4 different ones. I want to return nothing or zero in that case. (otherwise it copies the cell to the right). Pretty confusing, but logical. I want to sum up all results.
Last edited by excelcandy; 10-10-2013 at 04:45 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks