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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,142
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
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
 

pkew22

New Member
Joined
Aug 30, 2013
Messages
38
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,305
Messages
5,836,534
Members
430,437
Latest member
Emilycr

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
Top