Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 03-30-2018, 09:11 AM
rsrasc rsrasc is offline Need Macro to Move Text in a Row Windows 10 Need Macro to Move Text in a Row Office 2013
Competent Performer
Need Macro to Move Text in a Row
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to move cells ewso Excel Programming 1 10-11-2017 12:23 AM
Need Macro to Move Text in a Row A macro to find a symbol, delete it, and move the cursor to that location 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
Need Macro to Move Text in a Row Macro to move focus after entry in a cell 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

Other Forums: Access Forums

All times are GMT -7. The time now is 11:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft