studentlearner
New Member
- Joined
- Oct 7, 2021
- Messages
- 30
- Office Version
- 365
- Platform
- Windows
so currently I can find the whole column according to a specific cell value, but now I require it to find another column based on the found values. any help would be great thanks!
Sub findAll()
Dim c As Range
Dim findWhat As String
Dim i As Long
i = 2
With Worksheets(1).Range("C:C")
Set c = .Find(What:=Range("P2").Value, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Cells(i, 17) = c.Value
Set c = .FindNext(c)
i = i + 1
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
So right now I wish to get the found data of column 'G' together with the found data.
Sub findAll()
Dim c As Range
Dim findWhat As String
Dim i As Long
i = 2
With Worksheets(1).Range("C:C")
Set c = .Find(What:=Range("P2").Value, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Cells(i, 17) = c.Value
Set c = .FindNext(c)
i = i + 1
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
So right now I wish to get the found data of column 'G' together with the found data.