Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a form that when opens has a button attached, tht when pressed executes a sub that makes changes on the frm. I would like to get rid of the button and have the sub auto execute when the form opens. ive tries linking the sub to form initilize but no joy any ideas -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=482433 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ceemo,
Move the button code into the userform's initialze event, i.e.: Private Sub UserForm_Initialize() 'Your button code End Sub --- Regards, Norman "ceemo" wrote in message ... I have a form that when opens has a button attached, tht when pressed executes a sub that makes changes on the frm. I would like to get rid of the button and have the sub auto execute when the form opens. ive tries linking the sub to form initilize but no joy any ideas -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=482433 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sure!
When in the workbook do go here Visual Basics view project explorer this workbook 'now a code window is on the screen go to the down arrow in the box that reads (general) select workbook go to the next window to the right and select open ( you may already be on open) the code screen now reads: Private Sub Workbook_Open() 'your code(macro) goes in here End Sub have fun |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi DA,
I think that the OP refers to the form's initialisation, not the opening of the workbook: I would like to get rid of the button and have the sub auto execute when the form opens. --- Regards, Norman "damorrison" wrote in message oups.com... Sure! When in the workbook do go here Visual Basics view project explorer this workbook 'now a code window is on the screen go to the down arrow in the box that reads (general) select workbook go to the next window to the right and select open ( you may already be on open) the code screen now reads: Private Sub Workbook_Open() 'your code(macro) goes in here End Sub have fun |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() ive attached my book to help expain why i cant just paste the code tha the button is linked to into the initalise window using some progress code i found (you may reconise) im amending it so can run it without having to press the button on the form. so it wil just run when opened until 100% the auto clos -- ceem ----------------------------------------------------------------------- ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065 View this thread: http://www.excelforum.com/showthread.php?threadid=48243 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh Yeh!
I better go to bed! |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() missed it here it i -- ceem ----------------------------------------------------------------------- ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065 View this thread: http://www.excelforum.com/showthread.php?threadid=48243 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() b**locks cant get it to attach oh well -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=482433 |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ceemo,
Very properly, few in this NG would be prepared to open unknown attachments. Try instead explaining the intrinsic problem and, if necessary, post the button code. --- Regards, Norman "ceemo" wrote in message ... missed it here it is -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=482433 |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Private Sub UserForm_Initialize() ' ProgressBar1 labPg1.Tag = labPg1.Width labPg1.Width = 0 labPg1v.Caption = "" labPg1va.Caption = "" End Sub Private Sub CommandButton2_Click() DemoProgress1 End Sub Sub DemoProgress1() ' ' Progress Bar ' Dim intIndex As Integer Dim sngPercent As Single Dim intMax As Integer Application.Cursor = xlWait intMax = 25 For intIndex = 1 To intMax sngPercent = intIndex / intMax ProgressStyle1 sngPercent, True DoEvents '------------------------ ' Your code would go here '------------------------ Sleep 100 Next Application.Cursor = xlDefault Unload Me End Su -- ceem ----------------------------------------------------------------------- ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065 View this thread: http://www.excelforum.com/showthread.php?threadid=48243 |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
change
Private Sub CommandButton2_Click() DemoProgress1 End Sub To Private Sub Userform_Activate() DemoProgress1 End Sub -- Regards, Tom Ogilvy "ceemo" wrote in message ... Private Sub UserForm_Initialize() ' ProgressBar1 labPg1.Tag = labPg1.Width labPg1.Width = 0 labPg1v.Caption = "" labPg1va.Caption = "" End Sub Private Sub CommandButton2_Click() DemoProgress1 End Sub Sub DemoProgress1() ' ' Progress Bar ' Dim intIndex As Integer Dim sngPercent As Single Dim intMax As Integer Application.Cursor = xlWait intMax = 25 For intIndex = 1 To intMax sngPercent = intIndex / intMax ProgressStyle1 sngPercent, True DoEvents '------------------------ ' Your code would go here '------------------------ Sleep 100 Next Application.Cursor = xlDefault Unload Me End Sub -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=482433 |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() yep that worked thanks -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=482433 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
OT :Start your own online business today !start making dollars | Excel Discussion (Misc queries) | |||
How do I create a button on the toolbar that will start my form? | Excel Discussion (Misc queries) | |||
Start spreadsheet with WinXP start | Excel Worksheet Functions | |||
Form start position | Excel Programming | |||
can we start form by clicking hiperlink ? | Excel Programming |