+ Reply to Thread
Results 1 to 4 of 4

macros

  1. #1
    bunmi
    Guest

    macros

    i have sort of created a very simple user form in excel and put a little vba
    code in it. When i try running it, it comes up with a screen to do with
    macros. Does this mean I need macros just to even preview what the form would
    look like on its own? And if I do, how do I go about doing this? Thanks!

  2. #2
    Forum Contributor
    Join Date
    04-11-2005
    Location
    London
    Posts
    259
    If you want to preview the form, just click the run button on the Standard Toolbar in the Visual Basic Editor.

    Sometimes I place a button on the spreadsheet and attach it to a test harness macro like so...

    Sub LoadForm()
    UserForm1.Show
    End Sub

    Works for me
    Martin Short

  3. #3
    Charlie
    Guest

    RE: macros

    During development phase, if your cursor is in any sub or function of the
    userform. such as CommandButton1_Click your macro should run when you click
    the run button on the toolbar. Later add the line UserForm1.Show to the
    Workbook_open sub.

    Private Sub Workbook_Open()

    UserForm1.Show

    End Sub

    Now the userform will open whenever you open the workbook, or during
    development place the cursor in this sub before clicking the run button.


    "bunmi" wrote:

    > i have sort of created a very simple user form in excel and put a little vba
    > code in it. When i try running it, it comes up with a screen to do with
    > macros. Does this mean I need macros just to even preview what the form would
    > look like on its own? And if I do, how do I go about doing this? Thanks!


  4. #4
    David McRitchie
    Guest

    Re: macros

    You really should include the wording in "the little screen" but anyway, yes,
    in order to run macros you must have Tools, Macro, Security, [x] Medium

    Each time you open a file you will get a warning that the workbook has macros
    "Macros may contain viruses, ... "
    To which you reply with "Enable Macros" if you are familiar with the workbook
    and want to run macros; otherwise, "Disable Macros" and you can look at the
    macros, but not run them.
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "bunmi" <[email protected]> wrote...
    > i have sort of created a very simple user form in excel and put a little vba
    > code in it. When i try running it, it comes up with a screen to do with
    > macros. Does this mean I need macros just to even preview what the form would
    > look like on its own? And if I do, how do I go about doing this? Thanks!




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1