Hello, I am trying to use this vba macro that I got off the internet it does exactly what I want it to do, but I do not know how to setup it up here is the code.
Sub Find_Data()
' Written by Barrie Davidson
Dim datatoFind
Dim sheetCount As Integer
Dim counter As Integer
Dim currentSheet As Integer
On Error Resume Next
currentSheet = ActiveSheet.Index
datatoFind = InputBox("Please enter the value to search for")
If datatoFind = "" Then Exit Sub
sheetCount = ActiveWorkbook.Sheets.Count
If IsError(CDbl(datatoFind)) = False Then datatoFind = CDbl(datatoFind)
For counter = 1 To sheetCount
Sheets(counter).Activate
Cells.Find(What:=datatoFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
If ActiveCell.Value = datatoFind Then Exit Sub
Next counter
If ActiveCell.Value <> datatoFind Then
MsgBox ("Value not found")
Sheets(currentSheet).Activate
End If
End Sub
Here is the thing, I open up the vba editor and copy and paste that code, when I run the script I get a user form and it is blank and has nothing in it do I need to make a Input Box or something to make this work? What the code is suppose to do is I run it and it asks me for input and I type a name or data and it finds it in all the worksheets I have. and put the data on a separate worksheet . If anybody could help me asap that would be great. thanks
Bookmarks