+ Reply to Thread
Results 1 to 6 of 6

Code to add message box

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Code to add message box

    Greetings, All.

    What line of code would I need to add to the Save As code below to make a message box pop up that says "Your file has been saved as "whatever the filename is""? (The code saves the file as a filename based on the contents of a cell, I want the box to tell the user the name and location of the file.)

    Please Login or Register  to view this content.
    Thanks in advance for any help.

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523
    Hi there,

    The information you need is within the VBA ThisWorkbook.FullName script. Knowing that, here's (hopefully) what you're after:

    Please Login or Register  to view this content.
    HTH

    Robert

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Thanks.

    Thank you, Robert.

    I didn't expect it to be anything nearly as involved. I don't know anything about variables, but I guess that's why I'm posting questions and you're posting answers.

    Have a good one.

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Bump

    What if I just want the message box to read:

    "Your file has been saved as (Cell H18.value)"

    The last part being, or course, the actual value of cell H18, and without the parenthesis.

    Not worried about the directory, as it is hard coded and won't change.

    Can I do this by just adding one line of code?

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Got it!

    Never mind. I got it.

    It did only take one line of code, like this.

    Please Login or Register  to view this content.
    Thanks.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You already have the file name as a variable so use


    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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