![]() |
#3
|
|||
|
|||
![]() Quote:
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 Regards, rsrasc |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
macro to move cells | ewso | Excel Programming | 1 | 10-11-2017 12:23 AM |
![]() |
JayBird24 | Word VBA | 1 | 08-19-2016 04:26 PM |
How to move data - Macro not working | ecarter312 | Excel Programming | 1 | 08-10-2016 11:26 PM |
![]() |
Phil H | Excel Programming | 3 | 06-18-2015 01:20 PM |
Macro - Can I move information from a website and excel to word? | redzan | Word VBA | 1 | 03-13-2013 07:39 AM |