Mr Excel,
I would like to have a userform appear and then subsequently perform an operation automatically ie without clicking a command button on the userform. Is this the Userform_Initialise command??
I want to click a button on Sheet1, have the userform appear and then carry out an operation.
I am using a basic example to better understand what I am doing so that I can apply it to a bigger project.
The Additional control I am using is Microsoft Progress Bar 6.0 (SP4)
Example:
Click a button within Sheet1 and activate userform1. Using a loop macro, repeat 1000 times placing the value of each increment in cell A1 of sheet1. Whilst everything is happenning make a Progress Bar increment from 1 to 1000 at the same time.
My code is as follows:
Private Sub CommandButton1_Click() 'Don't want to use a button
ProgressBar1.Min = 0
ProgressBar1.Max = 1000
For Count = 1 To 1000
ProgressBar1.Value = Count
'my code here
Sheets("Sheet1").Select
Range("A1").Select
ActiveCell = Count + 1
Next
Unload Me
End Sub
If you could help me out with some pointers I will definately owe you one!!
Thanks.
Michael.
This message was edited by michaeldh on 2002-08-18 03:03
I would like to have a userform appear and then subsequently perform an operation automatically ie without clicking a command button on the userform. Is this the Userform_Initialise command??
I want to click a button on Sheet1, have the userform appear and then carry out an operation.
I am using a basic example to better understand what I am doing so that I can apply it to a bigger project.
The Additional control I am using is Microsoft Progress Bar 6.0 (SP4)
Example:
Click a button within Sheet1 and activate userform1. Using a loop macro, repeat 1000 times placing the value of each increment in cell A1 of sheet1. Whilst everything is happenning make a Progress Bar increment from 1 to 1000 at the same time.
My code is as follows:
Private Sub CommandButton1_Click() 'Don't want to use a button
ProgressBar1.Min = 0
ProgressBar1.Max = 1000
For Count = 1 To 1000
ProgressBar1.Value = Count
'my code here
Sheets("Sheet1").Select
Range("A1").Select
ActiveCell = Count + 1
Next
Unload Me
End Sub
If you could help me out with some pointers I will definately owe you one!!
Thanks.
Michael.
This message was edited by michaeldh on 2002-08-18 03:03