Find, Cut and Paste, Excel VBA

pkew22

New Member
Joined
Aug 30, 2013
Messages
29
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.
 

Some videos you may like

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Momentman

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

Watch MrExcel Video

Forum statistics

Threads
1,109,388
Messages
5,528,408
Members
409,817
Latest member
JiNXX9500

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top