Help with a multi find Macro

tbcoolguy

New Member
Joined
Feb 24, 2011
Messages
2
I am having some difficulties with a Macro I am currently working on. Specifically, I have having problems using 2 Find functions. Separetly I am able to get them to work properly but it seems I have issues having work together.

In general, my intentions with this Macro is to copy information listed in spreadsheet A to spreadsheet B beased upon the the date the user enters. Both spreadsheet A and B have date references.

Here is the code I have thus far:

Code:
Code:
Sub Find_First()
    Dim wb As String
    Dim FindString As String
    Dim Rng As Range
    
    wb = Range("w1").Value
        FindString = InputBox("Enter Date in mm/dd/yy format")

        
If Trim(FindString) <> "" Then
        With Sheets("Sheet1").Range("A:A")
            Set Rng = .Find(what:=FindString, _
                            After:=.Cells(.Cells.Count), _
                            LookIn:=xlValues, _
                            LookAt:=xlWhole, _
                            SearchOrder:=xlByRows, _
                            SearchDirection:=xlNext, _
                            MatchCase:=False)
                            ActiveSheet.Range(Cells(Application.ActiveCell.Row, 2), Cells(Application.ActiveCell.Row, 23)).Copy

    
    Workbooks.Open("FileB.xls").Activate
            
                Sheets(wb).Select

         If Not Rng Is Nothing Then
                Application.Goto Rng, True
            Else
                MsgBox "Nothing found"
            End If
        End With
    End If
        
        
        If Trim(FindString) <> "" Then
        With Sheets(wb).Range("B3:B367")
            Set Rng = .Find(what:=FindString, _
                            After:=.Cells(.Cells.Count), _
                            LookIn:=xlValues, _
                            LookAt:=xlWhole, _
                            SearchOrder:=xlByRows, _
                            SearchDirection:=xlNext, _
                            MatchCase:=False)
                            Cells(Application.ActiveCell.Row, 11).Select
                           ActiveSheet.Paste
                           Application.CutCopyMode = False
                           
                        

                            
                            
                            
                            
                                                                                    
                                                                                    
                  If Not Rng Is Nothing Then
                Application.Goto Rng, True
            Else
                MsgBox "Nothing found"
        End If
        End With
    End If
End Sub

Thank you in advance for your help!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,224,603
Messages
6,179,855
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top