+ Reply to Thread
Results 1 to 9 of 9

Writing a file’s name (or renaming it ) based on existing excel sheet data

  1. #1
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Exclamation Writing a file’s name (or renaming it ) based on existing excel sheet data

    What I have :
    1. Have a file name subbby.pdf in a folder
    2. Have an excel sheet (screenshot attached& excel sheet attached)


    What I need :
    • Having given the directory where this file is located, I want the VBA program to select that file;
    • Then ask the user for a file number (see attached screenshot or excel sheet) : I presume this can be done by an input MsgBox
    • Then rename this file as “Sr. Number_subbby_filenumber.pdf”
    • Also populate the excel sheet with the new name

    If gone by the attached screenshot, it shall be : 4_subbby_173B16.pdf ; where 173B16 shall be the file number

    Attachments
    1. Screenshot of the table
    2. Excel sheet with the table

    My Attempts:
    For renaming the file, I tried using
    Please Login or Register  to view this content.
    . But here, the new file name is to be generated by two inputs, namely, the user input (file number) & sr.number(from the existing excel sheet)


    Any help is most welcome. Thanks in advance

    Cross Posted by me in :
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by subbby; 08-30-2012 at 08:03 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Writing a file’s name (or renaming it ) based on existing excel sheet data

    Are the files all in the same filepath/folder?

  3. #3
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Writing a file’s name (or renaming it ) based on existing excel sheet data

    rvasquez,

    nope they are in different folders

    subbby.pdf shall have a different file path and the existing excel sheet is on a different file path

    Thanks.
    Last edited by subbby; 08-29-2012 at 08:19 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Writing a file’s name (or renaming it ) based on existing excel sheet data

    Where will you be specifying where the document is located?

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Writing a file’s name (or renaming it ) based on existing excel sheet data

    Remember what the dormouse said
    Feed your head

  6. #6
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Writing a file’s name (or renaming it ) based on existing excel sheet data

    Any help in this regard will be highly appreciated.


    I have been trying different codes but unable to figure out this one. M pretty new to VBA programming
    Last edited by subbby; 08-30-2012 at 11:02 AM.

  7. #7
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Writing a file’s name (or renaming it ) based on existing excel sheet data

    Quote Originally Posted by rvasquez View Post
    Where will you be specifying where the document is located?
    Used this code I got from the net . This gives locates the file

    Please Login or Register  to view this content.

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Writing a file’s name (or renaming it ) based on existing excel sheet data

    Thanks RS

    Hello subbby, and welcome to the forum.

    Unfortunately you have inadvertently broken one of the forum rules. Please read the following and make the necessary change. Thanks.

    Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

  9. #9
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Writing a file’s name (or renaming it ) based on existing excel sheet data

    @ Cutter

    Done ! Thanks ...

    Hope someone helps !
    Last edited by Cutter; 08-30-2012 at 09:14 PM. Reason: Removed whole post quote

+ 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