View Single Post
 
Old 03-30-2018, 09:11 AM
rsrasc rsrasc is offline Windows 10 Office 2013
Competent Performer
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

Quote:
Originally Posted by NoSparks View Post
Can you elaborate a little more please:

Do all of the more than 500 worksheets in the workbook require this ?
What separates or distinguishes John Doe1 from John Doe2 ?
Why the blank row 3 ?
From column D to column H (5 columns) <> Column M through Column R (6 columns)

Post the macro you now have and are wanting help with.

Thank you NoSparks for asking. Let me rephrase what I said because I got this wrong from the beginning. The file with over 500 pages is a word document. I saved the file as plain text and then open it with Excel. The excel file has over 15,000 rows of information.

Within this 15,000 rows of information, the word "ANNUAL LEAVE REGULAR HOURS" is listed over 550 times (this for number of employees in the file), and to see how is presented in the file, I suggest you open the attachment to see how they are listed in the file.


My intention is to find a macro that will move the text "ANNUAL LEAVE REGULAR HOURS", and everything that is right after the text and move it seven columns (column M through column S) to the right and two rows up.

I found the below macro (not mine) but it is only moving the text information but not the information from column D to column I.

HTML Code:
Sub Findandcut4()
'This macro will move the word "ANNUAL LEAVE REGULAR HOURS" from Column C to Column M
    Dim row As Long
    For row = 2 To 50000
        ' Check if "save" appears in the value anywhere.
        If Range("C" & row).Value Like "ANNUAL LEAVE REGULAR HOURS*" Then
            ' Copy the value and then blank the source.
            Range("M" & row).Value = Range("C" & row).Value
            Range("C" & row).Value = ""
        End If
    Next
End Sub
Hope this will help clarify and help find a solution.

Regards,
rsrasc
Reply With Quote