PC Review


Reply
Thread Tools Rate Thread

Autostart Macro

 
 
=?Utf-8?B?TWNDbG91ZEs=?=
Guest
Posts: n/a
 
      19th Sep 2007
I would like a simple text box or message to appear when a spreadsheet is
first opened that will require the user to push OK.

What I actually want is a box to pop up as sson as the spreadsheet is opened
that says "Only enter data in cells that are color coded Tan!" I would like
the message to stay on the screen until the uses clicks an OK button.

How would I accomplish this?

Thanks,

Ken
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2V2aW4gQg==?=
Guest
Posts: n/a
 
      19th Sep 2007
Press Alt+F11 and in the project explorer on the left of the screen, double
click ThisWorkbook to open the workbook module.

Place something similar to the following code in the Workbook's On Open event.

Private Sub Workbook_Open()

MsgBox "Only enter data in the cells w/tan color."

End Sub
--
Kevin Backmann


"McCloudK" wrote:

> I would like a simple text box or message to appear when a spreadsheet is
> first opened that will require the user to push OK.
>
> What I actually want is a box to pop up as sson as the spreadsheet is opened
> that says "Only enter data in cells that are color coded Tan!" I would like
> the message to stay on the screen until the uses clicks an OK button.
>
> How would I accomplish this?
>
> Thanks,
>
> Ken

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      19th Sep 2007
This goes in a General module--not behind a worksheet, not behind ThisWorkbook.

Option Explicit
Sub Auto_Open()
Msgbox "Only enter data in cells that are color coded Tan!"
End Sub



McCloudK wrote:
>
> I would like a simple text box or message to appear when a spreadsheet is
> first opened that will require the user to push OK.
>
> What I actually want is a box to pop up as sson as the spreadsheet is opened
> that says "Only enter data in cells that are color coded Tan!" I would like
> the message to stay on the screen until the uses clicks an OK button.
>
> How would I accomplish this?
>
> Thanks,
>
> Ken


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?TmFyYXNpbWhh?=
Guest
Posts: n/a
 
      22nd Nov 2007
Hi Dave ,
could you please help me how to enter text in two lines of message box ?
and how to change font properties colour etc...


"Dave Peterson" wrote:

> This goes in a General module--not behind a worksheet, not behind ThisWorkbook.
>
> Option Explicit
> Sub Auto_Open()
> Msgbox "Only enter data in cells that are color coded Tan!"
> End Sub
>
>
>
> McCloudK wrote:
> >
> > I would like a simple text box or message to appear when a spreadsheet is
> > first opened that will require the user to push OK.
> >
> > What I actually want is a box to pop up as sson as the spreadsheet is opened
> > that says "Only enter data in cells that are color coded Tan!" I would like
> > the message to stay on the screen until the uses clicks an OK button.
> >
> > How would I accomplish this?
> >
> > Thanks,
> >
> > Ken

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      22nd Nov 2007
You can't change the font properties in a plain old msgbox. But you could
design your own userform and do as much customization as you want:

Option Explicit
Sub Auto_Open()
Msgbox "Only enter data in cells" & vblf & "that are color coded Tan!"
'or
Msgbox "Only enter data in cells" & vbnewline & "that are color coded Tan!"
End Sub

In the windows world, vblf (linefeed) is sufficient.

If you have to support both Wintel and Mac's, you may want to use vbnewline.
That constant is smart enough to know what to use on each.

Narasimha wrote:
>
> Hi Dave ,
> could you please help me how to enter text in two lines of message box ?
> and how to change font properties colour etc...
>
> "Dave Peterson" wrote:
>
> > This goes in a General module--not behind a worksheet, not behind ThisWorkbook.
> >
> > Option Explicit
> > Sub Auto_Open()
> > Msgbox "Only enter data in cells that are color coded Tan!"
> > End Sub
> >
> >
> >
> > McCloudK wrote:
> > >
> > > I would like a simple text box or message to appear when a spreadsheet is
> > > first opened that will require the user to push OK.
> > >
> > > What I actually want is a box to pop up as sson as the spreadsheet is opened
> > > that says "Only enter data in cells that are color coded Tan!" I would like
> > > the message to stay on the screen until the uses clicks an OK button.
> > >
> > > How would I accomplish this?
> > >
> > > Thanks,
> > >
> > > Ken

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
 
Reply With Quote
 
Narasimha
Guest
Posts: n/a
 
      22nd Nov 2007
Thank you Dave .

"Dave Peterson" wrote:

> You can't change the font properties in a plain old msgbox. But you could
> design your own userform and do as much customization as you want:
>
> Option Explicit
> Sub Auto_Open()
> Msgbox "Only enter data in cells" & vblf & "that are color coded Tan!"
> 'or
> Msgbox "Only enter data in cells" & vbnewline & "that are color coded Tan!"
> End Sub
>
> In the windows world, vblf (linefeed) is sufficient.
>
> If you have to support both Wintel and Mac's, you may want to use vbnewline.
> That constant is smart enough to know what to use on each.
>
> Narasimha wrote:
> >
> > Hi Dave ,
> > could you please help me how to enter text in two lines of message box ?
> > and how to change font properties colour etc...
> >
> > "Dave Peterson" wrote:
> >
> > > This goes in a General module--not behind a worksheet, not behind ThisWorkbook.
> > >
> > > Option Explicit
> > > Sub Auto_Open()
> > > Msgbox "Only enter data in cells that are color coded Tan!"
> > > End Sub
> > >
> > >
> > >
> > > McCloudK wrote:
> > > >
> > > > I would like a simple text box or message to appear when a spreadsheet is
> > > > first opened that will require the user to push OK.
> > > >
> > > > What I actually want is a box to pop up as sson as the spreadsheet is opened
> > > > that says "Only enter data in cells that are color coded Tan!" I would like
> > > > the message to stay on the screen until the uses clicks an OK button.
> > > >
> > > > How would I accomplish this?
> > > >
> > > > Thanks,
> > > >
> > > > Ken
> > >
> > > --
> > >
> > > Dave Peterson
> > >

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to autostart a macro? Delivery Microsoft Excel Programming 1 21st Jan 2010 04:09 PM
Autostart macro-protect file Mia Microsoft Excel Programming 7 9th Jun 2009 01:24 PM
Macro Autostart when opening a file Snoopy Microsoft Excel Discussion 2 28th Aug 2008 12:46 PM
Excel 2003 - How to set up autostart macro? flumpf Microsoft Excel Misc 1 14th Nov 2003 06:49 AM
RE: autostart macro =?Utf-8?B?c3RhbmhvYw==?= Microsoft Excel Setup 0 28th Oct 2003 03:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:54 PM.