+ Reply to Thread
Results 1 to 3 of 3

msgbox startup

  1. #1
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    msgbox startup

    Hello to all.
    how can I do this:
    startup of the workbook should appear a msgbox:

    what format you want to file, .xls or .xlsx?
    then a data validation to choose which then has to change this part of the macro:

    '================================================================================================
    'questa la nuova parte aggiunta

    estensione = ".xls" ' xls or xlsx

    sNomeFile = sPath & "\" & sWB & " - " & nSfx & estensione 'con numero progreessivo

    If estensione = ".xls" Then
    wsDest.SaveAs Filename:=sNomeFile, FileFormat:=56 '<<< per formato xls
    Else
    wsDest.SaveAs Filename:=sNomeFile, FileFormat:=51 '<<< per formato xslx
    End If
    '================================================================================================

    A greeting,
    max_max

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: msgbox startup

    The attached workbook has code to make the selection at the end instead of the beginning is this OK? Your workbook must be macro-enabled for this to work.

    First there is the user form. To get the form into your workbook, download GetExtension.zip to a place on your hard drive and unzip it. Then open your workbook and press ALT-F11. Then go to File -> Import and navigate to where you saved the files. Import GetExtension.frm

    While you have the VB editor open, do the following:

    Click on ThisWorkbook and add the following code to run when the workbook is closed.
    Please Login or Register  to view this content.
    This code opens the form.

    Then Insert a regular module and use the following code
    Please Login or Register  to view this content.
    Take out my code for closing the workbook and put in your own.

    The from has a caption and a button, both labeled in English. You can change these captions. Click on the form to change the form caption, and click on the button to change the button caption.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by dflak; 06-06-2016 at 12:20 PM.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: msgbox startup

    Thanks you Dflak.
    Your solution is optimal.
    A greeting.
    max_max

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to capture MsgBox prompt to a string variable but ignore the MsgBox
    By BuglerDobbs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2015, 10:56 AM
  2. [SOLVED] Problem with VBA Editor uses lower case on some lines (ex. msgbox instead of MsgBox)
    By stubbsj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-14-2013, 06:59 PM
  3. MsgBox-center the message on a msgbox
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2007, 06:48 AM
  4. startup
    By skimpw in forum Excel General
    Replies: 1
    Last Post: 10-23-2006, 07:58 PM
  5. Startup
    By BillCPA in forum Excel General
    Replies: 2
    Last Post: 05-30-2006, 04:25 PM
  6. [SOLVED] MsgBox-at the end a msgBox popup
    By CC in forum Excel General
    Replies: 4
    Last Post: 05-05-2006, 12:50 PM
  7. [SOLVED] startup
    By Walid M. Bahgat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2005, 01:05 AM

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