Profress Indicator

P

pgarcia

I have this bit of code but I'm having problems with it, could you take a
look and point me in the right direction? I can't seem to get the form to
update.
Thanks

Sub Test()
UserForm1.LabelProgress.Width = 0
UserForm1.Show
End Sub

Sub CMSFuel()

Dim PctDone As Single

With UserForm1
.FrameProgress.Caption = Format(PctDone, "0%")
.LabelProgress.Width = PctDone * (.FrameProgress.Width - 10)
DoEvents
End With

Application.ScreenUpdating = False
Application.StatusBar = "One moment please..."
Sheets("0017").Select
Range("D1").Select
ActiveCell.FormulaR1C1 = "=TEXT(RC[-2],""0000"")"
Range("D1").Select
Selection.AutoFill Destination:=Range("D1:D95")
Range("D1:D95").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range("D1:D95").Cut Destination:=Range("B1:B95")
Range("D1").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-3],RC[-2],"" "",RC[-1])"
Selection.AutoFill Destination:=Range("D1:D95")
Range("D1:D95").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Columns("A:C").Select
Range("C1").Activate
Selection.Delete Shift:=xlToLeft
Range("A1").Select
ChDir "C:\Documents and Settings\autpbg1\Desktop\test cms"
ActiveWorkbook.SaveAs Filename:="C:\Documents and
Settings\autpbg1\Desktop\test cms\d0017ar.txt", _
FileFormat:=xlText, CreateBackup:=False
Sheets("In Put Tab").Select
MsgBox ("The update is now complete.")
Unload UserForm1
End Sub
 
P

pgarcia

Ya, there's not "edit" on this forms. It's also in the wrong place.

FSt1 said:
hi
what are you trying to do? Progress bar????

pgarcia said:
I have this bit of code but I'm having problems with it, could you take a
look and point me in the right direction? I can't seem to get the form to
update.
Thanks

Sub Test()
UserForm1.LabelProgress.Width = 0
UserForm1.Show
End Sub

Sub CMSFuel()

Dim PctDone As Single

With UserForm1
.FrameProgress.Caption = Format(PctDone, "0%")
.LabelProgress.Width = PctDone * (.FrameProgress.Width - 10)
DoEvents
End With

Application.ScreenUpdating = False
Application.StatusBar = "One moment please..."
Sheets("0017").Select
Range("D1").Select
ActiveCell.FormulaR1C1 = "=TEXT(RC[-2],""0000"")"
Range("D1").Select
Selection.AutoFill Destination:=Range("D1:D95")
Range("D1:D95").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range("D1:D95").Cut Destination:=Range("B1:B95")
Range("D1").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-3],RC[-2],"" "",RC[-1])"
Selection.AutoFill Destination:=Range("D1:D95")
Range("D1:D95").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Columns("A:C").Select
Range("C1").Activate
Selection.Delete Shift:=xlToLeft
Range("A1").Select
ChDir "C:\Documents and Settings\autpbg1\Desktop\test cms"
ActiveWorkbook.SaveAs Filename:="C:\Documents and
Settings\autpbg1\Desktop\test cms\d0017ar.txt", _
FileFormat:=xlText, CreateBackup:=False
Sheets("In Put Tab").Select
MsgBox ("The update is now complete.")
Unload UserForm1
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top