Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Assistance with excel VBA please?

$
0
0
I have been working on an inventory system and since I appear to have plenty of time I decided to base it off of a system that was used once before. Right now I have figured out how to use VB to search for part numbers in the list sheet and return a result in the form of the part number being found in the list. It displays in a message box and what I am looking to do is alter what I have to add not only the part number but the location of the part into the message box as well. I have tried a few different things but I am kind of lost on this since I am pretty new to VBA. Any assistance would be appreciated. Thank you. There is a zip file of the sample that can be used for what I am doing. Again thank you for your assistance!

Here is the code:
Code:

Sub Find_First()
    Dim FindString As String
    Dim Rng As Range
    FindString = InputBox("Enter a Search value")
    If Trim(FindString) <> "" Then
        With Sheets("ERGO II Spares").Range("B7:C486")
            Set Rng = .Find(What:=FindString, _
                            After:=.Cells(.Cells.Count), _
                            LookIn:=xlValues, _
                            LookAt:=xlPart, _
                            SearchOrder:=xlByRows, _
                            SearchDirection:=xlNext, _
                            MatchCase:=False)
                            MsgBox "Found here  " & Rng
            If Not Rng Is Nothing Then
                Application.Goto Rng, True
            Else
                MsgBox "Nothing found"
            End If
        End With
    End If
End Sub

Attachment 14171

Attached Files
File Type: zip Ergo prototype(2).zip (21.4 KB)

Viewing all articles
Browse latest Browse all 13329

Trending Articles