+ Reply to Thread
Results 1 to 9 of 9

Combining Two VBA's Excel 2013

  1. #1
    Registered User
    Join Date
    07-19-2013
    Location
    Scranton, Pa
    MS-Off Ver
    Excel 2013
    Posts
    14

    Combining Two VBA's Excel 2013

    Hi, I need some help combining the two subs below. The first Sub ExcelRangeToWord has been placed in the sheet 1 tab and the Sub DocSearch has been placed in the This Workbook tab.

    I would like both of them to run at the same time. Right now if you run the first one, it will open the specific Word document and copy the tables over. You then have to save and close the word document and run the second sub.

    I would like them both to run and then perform a Save As to a different location so the original word document is untouched.

    Thank you,
    Colby

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Combining Two VBA's Excel 2013

    Try something like this - it should be in a normal module and you'll need to alter the save path at the end of the first routine:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    07-19-2013
    Location
    Scranton, Pa
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Combining Two VBA's Excel 2013

    It works perfectly!

    Thank you!
    Colby

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Combining Two VBA's Excel 2013

    Glad to help.

  5. #5
    Registered User
    Join Date
    07-19-2013
    Location
    Scranton, Pa
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Combining Two VBA's Excel 2013

    I actually have one more question.
    Is there a way to do a save as to a variable from the Excel document? I want to avoid someone accidentally saving over previous work?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Combining Two VBA's Excel 2013

    Sure - what's the variable?

  7. #7
    Registered User
    Join Date
    07-19-2013
    Location
    Scranton, Pa
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Combining Two VBA's Excel 2013

    Would it be possible to pull from two cells within the Excel worksheet? On Sheet 1, from cells C1 and C5. C1 is a name and C5 is the date.

    Thanks!

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Combining Two VBA's Excel 2013

    You'd just change this line:
    Please Login or Register  to view this content.
    to something like:
    Please Login or Register  to view this content.
    Note that you need to format the date as you can't use "/" in a file name.

  9. #9
    Registered User
    Join Date
    07-19-2013
    Location
    Scranton, Pa
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Combining Two VBA's Excel 2013

    Once again, thank you!!

    Colby

+ 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. No PowerPivot in Com Add ins Excel 2013 (Microsoft office professional plus 2013)
    By benoj2005 in forum PowerPoint Formatting & General
    Replies: 7
    Last Post: 09-18-2014, 09:13 AM
  2. [SOLVED] No Colour Formatting in Excel 2013 and Word 2013
    By pt68 in forum Excel General
    Replies: 4
    Last Post: 09-15-2014, 03:25 PM
  3. Replies: 3
    Last Post: 07-20-2014, 11:46 AM
  4. Excel 2013 and Outlook 2013
    By xlbeginnerxl in forum Excel General
    Replies: 3
    Last Post: 03-26-2014, 12:16 PM
  5. Link Excel 2013 to Word 2013
    By drosen99 in forum Word Formatting & General
    Replies: 20
    Last Post: 02-26-2013, 08:20 PM

Tags for this Thread

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