Find, Cut and Paste, Excel VBA

pkew22

New Member
Joined
Aug 30, 2013
Messages
38
I am using Excel 2010.
Row 2 in my spreadsheet is Column Headings
I would like to find all instances of "Dept Operations - Tendy" in Column E. (Say cell E3)
I would like to cut the number from Cell G3
Paste it to Cell G5

If in the next instance "Dept Operations - Tendy" is in Cell E71
I would like to cut the number from G71 and
Paste it into G73.

Dept Operations occurs several times. And there could be anywhere between 900 to 1500 rows of data.
Column Headings are always in Row 2.

Please help. Thank you.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Please give this a try on a copy of the data

Code:
Sub rowscutpaste()
    Dim I As Integer
    For I = 2 To Range("E" & Rows.Count).End(xlUp).Row
        If Cells(I, "E").Value = "Dept Operations - Tendy" Then
            Range("G" & I).Cut Range("G" & I).Offset(2, 0)
        End If
    Next I
End Sub
 
Upvote 0
Thank you for taking the time to help me!

It worked very well. Very useful code for me as I am getting spreadsheets like this all the time. This will save me a huge amount of time now that I will be able to automate it.
 
Upvote 0

Forum statistics

Threads
1,216,376
Messages
6,130,249
Members
449,568
Latest member
mwl_y

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