Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 08-30-2021, 11:39 AM
Purfleet Purfleet is offline progress of the calculation Windows 10 progress of the calculation Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

To be honest i cant work out what you are trying to do, but if you want some kind of progress bar you can add a row count that shows on another sheet (this only show every 100 rows, but you can change that) - you will have to update your code so that the find and replace are working on the orginal sheet and not the 'Progress' sheet

Code:
Sub BulkReplace()
  Dim Rng As Range, SourceRng As Range, ReplaceRng As Range
  
  Dim rCount As Long   '<New
  Dim tCount As Long '<New
  Dim aSheet As String '<New
  
  aSheet = ActiveSheet.Name
    
  On Error Resume Next
  Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
  Set SourceRng = Application.InputBox("Source data:", "Bulk Replace", Application.Selection.Address, Type:=8)
  Err.Clear
 
  If Not SourceRng Is Nothing Then
    Set ReplaceRng = Application.InputBox("Replace range:", "Bulk Replace", Type:=8)
    Err.Clear
    If Not ReplaceRng Is Nothing Then
      
      Application.ScreenUpdating = False
        
        Worksheets.Add.Name = "Progress"
        tCount = Worksheets(aSheet).Cells(Rows.Count, 1).End(xlUp).Row '<New
        
            Worksheets(aSheet).Activate
        
        For Each Rng In ReplaceRng.Columns(1).Cell
          
                SourceRng.Replace what:=Rng.Value, replacement:=Rng.Offset(0, 1).Value
                rCount = rCount + 1
               
                If Int(rCount) / rCount = 1 Then '<New
                    Application.ScreenUpdating = False '<New
                        Worksheets("Progress").Range("a1") = rCount & "/" & tCount '<New
                        Worksheets("Progress").Activate '<New
                    Application.ScreenUpdating = True '<New
                End If '<New
                
        Next
       End If
  End If
  Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Progress bar in a Table Mona0306 PowerPoint 0 04-04-2021 11:54 AM
progress of the calculation Calculate the progress per day pm1110 Excel 2 09-16-2015 02:34 AM
progress of the calculation how to add progress bar to the following vba sivasucmc Word VBA 2 07-27-2014 04:44 PM
progress of the calculation updating task progress ketanco Project 1 08-16-2012 05:09 AM
How to create a progress bar AfterLife6 Excel 1 07-31-2012 08:43 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:50 AM.


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