+ Reply to Thread
Results 1 to 5 of 5

Copy file And Rename it Using An Input BOx

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Thumbs up Copy file And Rename it Using An Input BOx

    hello evryone
    i m using this code for 2nd coping my file and rename it automatically......
    Please Login or Register  to view this content.
    i want when i want another copy always my path should be "C:\test\abc.xlsm"
    and
    for new file in same path "C:\test\def.xlsm" an input box ask for the name("def.xlsm") "what new name u want for this new file"

    and i input the new name for my file and done

    thanx plz help
    Last edited by HaroonSid; 03-15-2014 at 05:06 AM. Reason: solved

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy file And Rename it Using An Input BOx

    Hi, haroon2015,

    this will only accept the name of the new file and not the extension:
    Please Login or Register  to view this content.
    You would need to alter the code if you want to include the extension as well in order to give the file the proper fileformat (look for the last dot by using InStrRev and using Ifs or a Select Case to get the proper fileformat).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Copy file And Rename it Using An Input BOx

    Excellent : HaHoBe

    it's working as i need

    thanx a lot
    haroon2015

  4. #4
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Copy file And Rename it Using An Input BOx

    when run this code
    Please Login or Register  to view this content.
    + then run this code after above code... i mean merge both code in once macro file...plz need more help from u
    Please Login or Register  to view this content.
    thanx a lot

  5. #5
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Copy file And Rename it Using An Input BOx

    Please Login or Register  to view this content.
    HaHoBe i combine these two macro and it's working as i need

    but its asking for two time
    first time inputbox "What new name do you want for the new file?"
    second time
    Application.GetOpenFilename

    if possible then i want inputbox "What new name do you want for the new file?" and done both work in one click
    thanx

+ 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. Want a input box to make a copy of master file and rename it automatically
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2014, 02:39 AM
  2. Replies: 0
    Last Post: 01-21-2014, 10:52 AM
  3. rename & copy *.xls file in the folder then move
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2011, 12:22 PM
  4. Copy an entire excel file and rename it
    By xyz123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2008, 05:07 AM
  5. Copy sheets to new file and rename it
    By Jokacave in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2007, 08:33 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