Macro required

tagger1

New Member
Joined
Jun 18, 2011
Messages
3
Hi
I cant seem to work this one out myself.

Require a macro to do the following;

Search a column range A225 to A2500 for a number match to whatever number has been entered in A13.
When cell with matching number found then cut that row from A to H and paste it to Row A13 to H13.

All help greatly appreciated
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi and welcome.
Code:
Sub Find_and_Move()
    Dim Found As Range
    If Range("A13") <> "" Then
        Set Found = Range("A225:A2500").Find(Range("A13"), , xlValues, xlWhole, xlRows, xlNext, False)
        If Not Found Is Nothing Then
            Found.Resize(, 8).Cut Destination:=Range("A13")
            'Found.Resize(, 8).Delete Shift:=xlShiftUp
        Else
            MsgBox "No match found for " & Range("A13").Value, vbExclamation, "No Match"
        End If
    Else
        MsgBox "Cell A13 is empty.", vbInformation, "Search Canceled"
    End If
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,849
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