#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Progress

I've tried to use the 'progress indicator' to update on a peace of code.
Thing is, in the exercise (from John Walkenbach )the Main procedure adds
random numbers. What I would like to do is whenever I activate commandbutton1
or commandbutton2 (both buttons to be found in userform2) the progress
inidcator pops up. I however have no singel clue how to get about. I enclosed
a copy of my file.

Sheet TrimAll = where all the action happens
Sheet2 = Not used
Sheet3 = Not used

Userform1 pops up whenever you select the sheet. It asks the user if he/she
wants to delete HTML non-breaking spaces or not. If the user chooses to
delete the HTML non-breaking spaces Userform2 turns on. In this Userform (2)
the user can decide wether to adjust the whole package of data or just a
selection (using an inputbox). Now comes the tricky part (to me); in both
cases (so whenever a user chooses to adjust everything or just a selection)
I'd like to have a progress indicator displayed to them. Can you help me with
this (or just get me started)?!

Private Sub CommandButton1_Click()
Application.DisplayAlerts = True
Application.EnableEvents = True 'should be part of Change Event macro
If Application.Calculation = xlCalculationManual Then
MsgBox "Calculation was OFF will be turned ON upon completion"
End If
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
'Select active content
Range("A2").CurrentRegion.Select
Dim cell As Range
'Also Treat CHR 0160, as a space (CHR 032)
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
'Trim in Excel removes extra internal spaces, VBA does not
On Error Resume Next 'in case no text cells in selection
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
cell.Value = Application.Trim(cell.Value)
Next cell
On Error GoTo 0
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

Private Sub CommandButton2_Click()
Dim rng As Range
On Error Resume Next
Specify = Application.InputBox _
(prompt:="Specify a range", Type:=8).Select
Dim cell As Range
'Also Treat CHR 0160, as a space (CHR 032)
Selection.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
'Trim in Excel removes extra internal spaces, VBA does not
On Error Resume Next 'in case no text cells in selection
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
cell.Value = Application.Trim(cell.Value)
Next cell
On Error GoTo 0
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

Private Sub CommandButton3_Click()
Unload UserForm2
End Sub

Private Sub UserForm_Click()

End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PROGRESS BAR Ola2B Excel Discussion (Misc queries) 2 July 11th 07 08:13 PM
progress bar for XML Ton[_2_] Excel Programming 0 October 11th 06 10:25 AM
NEED Help - How to capture the Event's progress in Progress Bar Sriram Excel Programming 6 August 22nd 06 12:04 PM
Progress Bar ? CPhil[_3_] Excel Programming 2 April 12th 06 04:18 PM
Progress Bar Help Malcolm Excel Programming 2 November 21st 03 02:29 PM


All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"