Hi
I have looked all over and I cannot find an answer to what I originally thought would be quite straight forward
I am trying to make a front page for my parts and prices workbook which allows a user to enter a part number and the vba code returns the information for that part number.
The workbook consists of multiple worksheets (which is ongoing) one for each supplier and are named by supplier, so all unique, but all the layouts are the same.
The part number begins in C11 and the rest of the required information is in D11-G11
This is my borrowed code which will find and tell me which cell the entered part is in but I need it to return the rest of the information for that part number, vendor price cost etc
Public Sub FindText()
Dim ws As Worksheet, Found As Range
Dim myText As String, FirstAddress As String
Dim AddressStr As String, foundNum As Integer
myText = InputBox("Enter text to find")
If myText = "" Then Exit Sub
For Each ws In ThisWorkbook.Worksheets
With ws
Set Found = .UsedRange.Find(what:=myText, LookIn:=xlValues, LookAt:=xlPart, MatchCase:=False)
If Not Found Is Nothing Then
FirstAddress = Found.Address
Do
foundNum = foundNum + 1
AddressStr = AddressStr & .Name & " " & Found.Address & vbCrLf
Set Found = .UsedRange.FindNext(Found)
Loop While Not Found Is Nothing And Found.Address <> FirstAddress
End If
myNext:
End With
Next ws
If Len(AddressStr) Then
MsgBox "Found: """ & myText & """ " & foundNum & " times." & vbCr & _
AddressStr, vbOKOnly, myText & " found in these cells"
Else:
MsgBox "Unable to find " & myText & " in this workbook.", vbExclamation
End If
End Sub
Any help on this is greatly appreciated as I have no idea how macros work I just cannot get my head around it no matter how I try so I have massive respect for those of you that do
Thanks
Bookmarks