+ Reply to Thread
Results 1 to 7 of 7

Invoicing Summary - Taking certain information from an invoice to add to another workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    9

    Invoicing Summary - Taking certain information from an invoice to add to another workbook

    Hi All,

    I am in the process of creating an invoicing program for work. Essentially I would like to capture some items of an invoice that can be collected on another worksheet (Let's Call it 'Reporting Page') to create an organized report. I would like to do this by creating a button

    I would need to program the button so that it can capture and record the following on the 'Reporting Page':
    - Invoice Number
    - Date
    - Customer
    - Quantities for the certain items that are purchased.

    What I would also need to have done is that with every new invoice I create that the information can be properly recorded in the next column on the 'Reporting Page'.

    Please help. I am new in this forum but have seen how helpful this website truly is.

  2. #2
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Invoicing Summary - Taking certain information from an invoice to add to another workb

    Hi domgee,
    WELCOME TO THE FORUM!

    Please upload a sample workbook with some data. e.g show two seperate sheets one for before the Marco run then one for After the Marco run.
    Cheers,

    Joshi
    Being with a winner makes you a winner

  3. #3
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Invoicing Summary - Taking certain information from an invoice to add to another workb

    Do you have an invoice template developed? Have you gotten anywhere with creating the formatting of the workbook?

    If so, upload a copy so that we all can see what we are working with.

  4. #4
    Registered User
    Join Date
    06-03-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Invoicing Summary - Taking certain information from an invoice to add to another workb

    Here is the worksheet I'm working off of. I have set up the template how I would like to track the info on two worksheets but I have not applied a Macro to the button.

    Thanks for all the help you.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-03-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Invoicing Summary - Taking certain information from an invoice to add to another workb

    Any luck with this problem? Did you need any more information?

  6. #6
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Invoicing Summary - Taking certain information from an invoice to add to another workb

    Hi Domgee,

    Try using the following code and let me know if it has the desired result>

    Sub SendInvoiceDataToReport()
        Dim ws1 As Worksheet
        Dim ws2 As Worksheet
        Dim rngINV As Range
        Dim rngRPT As Range
        Dim cel As Range
        Dim nCol As Long
        
        Application.ScreenUpdating = False
        
        Set ws1 = Sheets("Invoice")
        Set ws2 = Sheets("Reporting Sheet")
        Set rngINV = ws1.Range("C12:C67")
        Set rngRPT = Range(ws2.Range("a9"), ws2.Range("a9").End(xlDown))
        nCol = ws2.Cells(3, Columns.Count).End(xlToLeft).Column + 1
            
        If WorksheetFunction.CountA(rngINV) = 0 Then
            MsgBox "No items listed"
            Exit Sub
        ElseIf WorksheetFunction.CountA(rngINV) = 1 Then
            Set rngINV = Range("C12")
        Else
            Set rngINV = Range(rngINV.Range("A1"), rngINV.Range("A1").End(xlDown))
        End If
        
        ws2.Cells(3, nCol) = ws1.Cells(7, 4)
        ws2.Cells(4, nCol) = ws1.Cells(7, 6)
        ws2.Cells(5, nCol) = ws1.Cells(1, 6)
        ws2.Cells(6, nCol) = ws1.Cells(70, 6)
        
        For Each cel In rngINV
            rngRPT.Find(cel).Offset(, nCol - 1) = cel.Offset(, 1)
        Next cel
            
        Application.ScreenUpdating = True
    End Sub

  7. #7
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Invoicing Summary - Taking certain information from an invoice to add to another workb

    The same thing only different.

    Sub Add2Report()
    Dim WS As Worksheet
    Dim A As Long
    Dim LastRow As Long
    Dim NextCol As Long
    
    Set WS = ActiveWorkbook.Worksheets("Reporting Sheet")
    
    With WS
        LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
        NextCol = WS.Cells(9, .Columns.Count).End(xlToLeft).Column + 1
        
        'Customer
        .Cells(3, NextCol).Formula = "=Invoice!$B7"
        'Invoice #
        .Cells(4, NextCol).Formula = "=Invoice!$F7"
        'Date
        .Cells(5, NextCol).Formula = "=Invoice!$F1"
        'Total
        .Cells(6, NextCol).Formula = "=Invoice!$F70"
        
        '=VLOOKUP(A9,Invoice!C12:D66,2,0)
        For A = 9 To LastRow
            .Cells(A, NextCol).Formula = "=VLOOKUP(A" & A & ", INVOICE!$C$12:$D$66,2,0)"
        Next
    End With
    End Sub
    David
    (*) Reputation points appreciated.

+ 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