Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2019, 09:57 PM
Guessed's Avatar
Guessed Guessed 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 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default


This does seem slower than I would expect. You could try this version using ranges but it doesn't show a significant speed improvement.
Code:
Sub Change_Value_to_Next_Cell_GOOD()
  Dim aRng As Range
  Dim sText As String
  sText = InputBox("Enter text to move cell")
  Set aRng = ActiveDocument.Range
  ActiveWindow.View = wdNormalView
  Application.ScreenUpdating = False
  With aRng.Find
    .ClearFormatting
    .Text = sText
    .Wrap = wdFindStop
    Do While .Execute
      If aRng.Information(wdWithInTable) Then
        aRng.Cells(1).Next.Range.FormattedText = aRng.FormattedText
        aRng.Delete
        aRng.MoveStart Unit:=wdCell, Count:=2
      End If
    Loop
  End With
  Application.ScreenUpdating = True
  MsgBox " You're Selection is Done in the Active Document!"
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

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 10:54 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