Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default On Form Start Up


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default On Form Start Up

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default On Form Start Up

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default On Form Start Up

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default On Form Start Up


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default On Form Start Up

Oh Yeh!
I better go to bed!

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default On Form Start Up


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

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
OT :Start your own online business today !start making dollars [email protected] Excel Discussion (Misc queries) 0 May 6th 06 09:29 PM
How do I create a button on the toolbar that will start my form? DMB Excel Discussion (Misc queries) 0 January 8th 06 11:00 PM
Start spreadsheet with WinXP start Gordon Gradwell Excel Worksheet Functions 1 July 13th 05 11:35 AM
Form start position drewdog Excel Programming 2 April 6th 04 02:15 AM
can we start form by clicking hiperlink ? Konrad[_4_] Excel Programming 1 October 27th 03 07:45 PM


All times are GMT +1. The time now is 12:05 AM.

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

About Us

"It's about Microsoft Excel"