Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-18-2019, 08:50 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help to spead up macro - Find and Replace in Tables, Cut Paste Next Cells Windows 10 Help to spead up macro - Find and Replace in Tables, Cut Paste Next Cells Office 2013
Competent Performer
Help to spead up macro - Find and Replace in Tables, Cut Paste Next Cells
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Smile Help to spead up macro - Find and Replace in Tables, Cut Paste Next Cells

I have this macro that works for me, the only thing, if I have 5 pages long of table(s), it takes for ever to do it 1 by 1 on each $ or %.

In a nut shell, I need to find $ or % in a table, then move it to the next cell which I've already created an empty column.
I wish I could show an example of a table picture, but I don't know how.

Normally Find and Replace, Execute All at once. What can I do to have it do it all at once?


This is my macro.....
Sub Change_Value_to_Next_Cell_GOOD()
'33
'Change_Value_to_Next_Cell Macro
' I can change the % or $ or any string of text and have it copy, cut, and paste to the next cell.
' Alt+2
'
Dim sText As String
sText = InputBox("Enter text to move cell")


Selection.Find.ClearFormatting
With Selection.Find
.Text = sText
.Wrap = wdFindStop
End With
Do While Selection.Find.Execute
If Selection.Information(wdWithInTable) = True Then
Selection.Copy
Selection.Cut
Selection.MoveRight Unit:=wdCell
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Selection.Move Unit:=wdCell, Count:=1
End If
Loop
MsgBox " You're Selection is Done in the Active Document!"
On Error GoTo 0

End Sub


Any insight would be appreciated.


Oh an added bonus, if I can find multiple values at once, such as if found $ or %, or another value, cut move to next cell, then paste.

P.S.1 Reason we must move the $ or % to the next cell, is because that is what we do in our French documents.
P.S.2 My table example to test a macro, has 5 columns of numbers only, with an extra empty columns on each columns to move in the $.

Thanks in advance


Cendrinne

Last edited by Cendrinne; 08-19-2019 at 08:45 AM. Reason: Added p.s. 2
Reply With Quote
 

Tags
find & replace, help please, speed



Similar Threads
Thread Thread Starter Forum Replies Last Post
what method to find all cells paste linked to a certain cell ? DBenz Excel 1 06-28-2018 12:16 PM
Select Cell Text to paste into Find/Replace CBarry Word VBA 2 02-16-2017 04:37 AM
Help to spead up macro - Find and Replace in Tables, Cut Paste Next Cells Find and Replace Macro amparete13 PowerPoint 3 03-11-2014 05:29 AM
macro or find/replace JamesVenhaus Word 2 02-27-2012 03:34 PM
Find and Replace Macro - A Better Way Tribos Word VBA 0 10-08-2008 03:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:58 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