+ Reply to Thread
Results 1 to 8 of 8

Change set workbook name from User input

  1. #1
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    409

    Change set workbook name from User input

    So, I am in the process of streamlining my at work excel tasks with VBA.

    So, below I have set wb2 as "Workbookexample Master WE 08-18-2018.xlsx" which I use for one week, then the date part changes within the filename for next week.
    I would like to read in the current wb2 file name and have the user be able to change only the date part of the file name and have wb2 equal the new file name the user updates too.
    How do I code this, I know there is use of an Inputbox or
    Can I use a file picker dialog box to select the file to work with for the new week to maybe update wb2 below.
    Thanks

    Please Login or Register  to view this content.
    ==========
    Bigroo1958
    Austin, Texas
    ==========

  2. #2
    Registered User
    Join Date
    10-12-2015
    Location
    Bristol, UK
    MS-Off Ver
    Office 365
    Posts
    39

    Re: Change set workbook name from User input

    You could use something like this, which gives you a variable FileName to use how you want

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    409

    Re: Change set workbook name from User input

    Thanks for the reply UnderscoreBadger, I think I understand where you a coming from.
    Thanks

    Does this look right for wb2 reference?

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Change set workbook name from User input

    It needs to be
    Please Login or Register  to view this content.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Change set workbook name from User input

    Is the workbook open?

    If it isn't you could use Application.GetOpenFileName to have the user pick the file from a dialog and then open it
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  6. #6
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    409

    Re: Change set workbook name from User input

    Thanks Fluff13, sorry for the delayed answer, that worked great!

  7. #7
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    409

    Re: Change set workbook name from User input

    Hi Norrie,

    I will explore your code and decide which one works better for my situation.
    I may come back with questions. I am starting to get in VBA and I believe I am following what you have presented.
    Thanks

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Change set workbook name from User input

    Glad we could help & thanks for the feedback

+ 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. Change event to Convert (calculate) user input if user types % sign
    By soundneedle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2016, 12:01 PM
  2. Change ranges used in VBA code with user input
    By ptuzzolo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2015, 07:14 PM
  3. [SOLVED] Trying to change a user input string
    By mrpwebb in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-19-2014, 10:19 AM
  4. Activating the Workbook Name from user input
    By LeapingLizard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2012, 01:13 PM
  5. User Input to change cell reference in formulas
    By williampdx in forum Excel General
    Replies: 5
    Last Post: 03-31-2010, 02:04 PM
  6. [SOLVED] Change color of cell after user has input a number
    By F7772 in forum Excel General
    Replies: 3
    Last Post: 08-29-2005, 05:05 PM
  7. [SOLVED] Preparing Workbook for user input
    By J. Stone in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2005, 04:06 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