+ Reply to Thread
Results 1 to 3 of 3

Macro Button that pulls sorted info from closed workbooks

  1. #1
    Registered User
    Join Date
    05-23-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2003
    Posts
    12

    Macro Button that pulls sorted info from closed workbooks

    Hello Everyone,

    I've posted rather elementary questions in the past, but this one is a bit of a doozie...

    I am building a reservation system based in excel that details reservation specifics in a daily graph, then exports the days reservations into a seperate workbook that compiles a full week. Attached is my daily sheet, and weekly sheet that I need to paste into.

    Optimally, this scenario unfolds -

    A Macro button existing in each tab in the Weekly Reservation book prompts a date range (ex. 06-27-13 through 07-03-13). The Longbook Master generates Files for each day, saved in the MM-DD-YY format. Based on date range given, filtered data (specifically the data falling between cells B2 and S51) from the Resv. Plan tab in the on each day is copied in time order onto the Weekly Reservation book (beginning in cell C2).

    Any additional information is readily available. Thank you so much!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-23-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro Button that pulls sorted info from closed workbooks

    Please help!

  3. #3
    Registered User
    Join Date
    05-23-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro Button that pulls sorted info from closed workbooks

    How can I modify this to work?

    Option Explicit

    Sub Sample()
    Dim wb1 As Workbook, wb2 As Workbook
    Dim Ret1, Ret2

    Set wb1 = ActiveWorkbook

    '~~> Get the first File
    Ret1 = Application.GetOpenFilename("Excel Files (*.xls*), *.xls*", _
    , "Please select first file")
    If Ret1 = False Then Exit Sub

    '~~> Get the 2nd File
    Ret2 = Application.GetOpenFilename("Excel Files (*.xls*), *.xls*", _
    , "Please select Second file")
    If Ret2 = False Then Exit Sub

    Set wb2 = Workbooks.Open(Ret1)
    wb2.Sheets(1).Cells.Copy wb1.Sheets(1).Cells
    wb2.Close SaveChanges:=False

    Set wb2 = Workbooks.Open(Ret2)
    wb2.Sheets(1).Cells.Copy wb1.Sheets(2).Cells
    wb2.Close SaveChanges:=False

    Set wb2 = Nothing
    Set wb1 = Nothing
    End Sub

+ 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