Hello chrns12,
Thanks for the reply.
This will help a lot! I think this will be enough to get me started and most probably will do the job in a slightly adjusted manner.
If everything works well I will post the result.
Thanks for now! Wiggert
Hello chrns12,
Thanks for the reply.
This will help a lot! I think this will be enough to get me started and most probably will do the job in a slightly adjusted manner.
If everything works well I will post the result.
Thanks for now! Wiggert
Help! It's not working yet.
I would like to use a simple search to find a specified value in an entire row.
Then when found, I would like to continue the search on the next row finding a different specified value.
I would like to use two for next loops to be able to use the cell number where the specified values are found and the row number of the specified value.
When this is all a bit vague. Then I just like to know how I can search a sheet row by row using two for next loops.
Thanks again! Wiggert
Ok, I came up with the following code but I would like to select the entire row or do untill cell is empty. Untill now I haven't been able to integrate that into the code.
Anyone?
The search code 'also as attachment.
Thanks, WiggertOption Explicit
Dim wsBD2 As Worksheet
Dim rownumber As Integer
Dim columnnumber As Integer
Dim rowProjectNumber As Integer
Dim columnfrom As Integer
Dim columnto As Integer
Dim projectTitle As Integer
Sub Find_Something()
Set wsBD2 = Worksheets("Blad1")
'Activate your starting column and cell
wsBD2.Range("F4").Activate
rownumber = 4
columnfrom = wsBD2.Range("E4").Column
columnto = wsBD2.Range("J4").Column
'Set the number of cells in the row you want to search through, example: 1 to 1000
For rowProjectNumber = wsBD2.Range("D5") To wsBD2.Range("D6")
'Set projectTitle to whatever you are looking for, example: wsBD2.Range("B2").Value
projectTitle = wsBD2.Range("D" & CStr(rowProjectNumber)).Value
'Set the number of cells in the column you want to search through, example: 1 to 1000
For columnnumber = columnfrom To columnto
'Check for a match to projectTitle
wsBD2.Cells(rownumber, columnnumber).Activate
If ActiveCell.Value = projectTitle Then
'Do something with what your match
MsgBox "Found"
End If
Next columnnumber
Next rowProjectNumber
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks