+ Reply to Thread
Results 1 to 6 of 6

macro to bring up stored workbook, auto save to a new folder, then auto fill

  1. #1
    Registered User
    Join Date
    09-08-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    macro to bring up stored workbook, auto save to a new folder, then auto fill

    Hello,

    I am trying to write a vba code that after starting a macro from workbook1 will bring up a workbook from a designated folder which we can call workbook2, then auto save workbook2 right when it comes up and call the file name from a cell from workbook1 cell A1 and save it to a new destination C:\saved folder, then prefills info in cells from a user form from workbook1 into workbook 2. Then after the info prefills into the cells from the userform to workbook2, the person just has to click the save button, then close and it automatically save to the C:\saved folder, without the person trying to find the destination folder. Below is what I have so far. This code will bring up workbook2 and will prefill the information, but just having a little trouble finding out how to auto save right away to a new destination folder. Thanks for the help


    Sub OpenUPaircalc()

    Dim nwb As Workbook

    Set nwb = Workbooks.Open("\\Library\DOCS\UW_Calculators.xlt")

    With nwb.Sheets(1)
    .Range("K40").Value = UserForm1.TextBox1.Text
    .Range("O40").Value = UserForm1.TextBox2.Text
    .Range("V40").Value = UserForm1.TextBox4.Text
    .Range("K62").Value = UserForm1.TextBox5.Text
    .Range("N62").Value = UserForm1.TextBox6.Text
    .Range("K74").Value = UserForm1.TextBox7.Text
    .Range("R74").Value = UserForm1.TextBox8.Text
    .Range("AA74").Value = UserForm1.TextBox9.Text
    .Range("K88").Value = UserForm1.TextBox10.Text
    .Range("I6").Value = Sheet1.Range("M1").Value
    .Range("Z6").Value = Sheet1.Range("L1").Value
    .Range("I8").Value = Sheet1.Range("I1").Value
    .Range("Q8").Value = Sheet1.Range("B3").Value
    .Range("Z8").Value = Sheet1.Range("L4").Value
    .Range("I10").Value = Sheet10.Range("A71").Value
    .Range("Z10").Value = Sheet10.Range("F63").Value
    .Range("I12").Value = Sheet1.Range("B6").Value



    End With
    End Sub

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: macro to bring up stored workbook, auto save to a new folder, then auto fill

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    09-08-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: macro to bring up stored workbook, auto save to a new folder, then auto fill

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-08-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: macro to bring up stored workbook, auto save to a new folder, then auto fill

    Thanks for letting me know about the rules. I have reposted and hopefully I did this correctly. Thanks again.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: macro to bring up stored workbook, auto save to a new folder, then auto fill

    Hi Rick,

    You're welcome (you could have just edited your first post).

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: macro to bring up stored workbook, auto save to a new folder, then auto fill

    Hi Rick,

    Maybe this code for your save button:

    Please Login or Register  to view this content.

+ 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. vba to print active sheet to pdf, auto save in specific folder then mail using outlook
    By lathamashly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2014, 04:57 AM
  2. auto save e-mail attachment to folder after sending
    By ncaravela in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2010, 05:23 PM
  3. auto save to a folder resurrection
    By stevesunfold in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-22-2008, 08:08 AM
  4. [SOLVED] Auto Excel workbook close: save= false during an auto subroutine
    By tomwashere2 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-16-2005, 02:05 AM
  5. I like to open a folder,auto print,save then close
    By tied of opening files in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2005, 06:06 PM

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