Related:         
- Data Link
 - Twitter link opener - Guide
 - Tmobile data check - Guide
 - Link manipulation - Guide
 - How to reset safe folder password without losing data ✓ - Android Forum
 - Microsoft store app official download link - Download - App downloads
 
2 responses
                
        
                    vcoolio
    
        
                    Posts
            
                
            1411
                
                            Registration date
            Thursday July 24, 2014
                            Status
            Moderator
                            Last seen
            September  6, 2024
            
            
                    262
    
    
                    
Jan 29, 2016 at 06:49 AM
    Jan 29, 2016 at 06:49 AM
                        
                    Hello Andy,
You can have one Excel work book with the invoice template in one sheet and the parts data base in another sheet.
Have a look at the following link to my test work book. As an example, I've rattled up a template more or less based on what you have explained, not knowing what your work book actually looks like:-
https://www.dropbox.com/s/jdmzhliokxpnr2k/Andy%27s%20Invoice%20Template.xlsm?dl=0
The following codes should do the task for you and are assigned to the buttons in the test work book:-
The "Fill Invoice" button is self explanatory. The code assigned to this button copies the part details from the data base in sheet2 via a drop down validation list in sheet1, cell J8 which lists the part numbers. Select a part number and click on the "Fill Invoice" button to extract the part number data.
The "Save and Clear" button saves the invoice to your selected file as a PDF. You will need to enter your required file path in the code (line 38 in the above code). It then clears the invoice and increments the invoice number ready for your next invoice. There are some explanatory notes in the test work book.
I hope that this at least gets you underway and hopefully in the right direction!
Cheerio,
vcoolio.
            You can have one Excel work book with the invoice template in one sheet and the parts data base in another sheet.
Have a look at the following link to my test work book. As an example, I've rattled up a template more or less based on what you have explained, not knowing what your work book actually looks like:-
https://www.dropbox.com/s/jdmzhliokxpnr2k/Andy%27s%20Invoice%20Template.xlsm?dl=0
The following codes should do the task for you and are assigned to the buttons in the test work book:-
Sub HideShapes()
Application.ScreenUpdating = False
Dim myshape As Shape
    For Each myshape In ActiveSheet.Shapes
    myshape.Visible = False
Next
Application.ScreenUpdating = True
End Sub
Sub NextInvoice()
Application.ScreenUpdating = False
Dim myshape As Shape
    Range("J6").Value = Range("J6").Value + 1
    Range("B6:H9").ClearContents
    Range("A12:H48").ClearContents
    Range("I11:J48").ClearContents
    
    For Each myshape In ActiveSheet.Shapes
    myshape.Visible = True
Next
Application.ScreenUpdating = True
End Sub
 Sub SaveInvoiceAsPDF()
 
 Application.ScreenUpdating = False
 
     HideShapes
     
     NewFN = "C:\Your FilePath Here\" & Range("B6").Value & ".pdf"   '---->Range("B6") is the Client name.
     ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFN, _
     Quality:=xlQualityStandard, IncludeDocProperties:=True, _
     IgnorePrintAreas:=False, OpenAfterPublish:=False
     NextInvoice
     
Application.ScreenUpdating = True
 End Sub
 
Sub CopyData()
Application.ScreenUpdating = False
        Dim PartNum As String
        Dim lr As Long
        
PartNum = Sheet1.Range("J8").Value
lr = Range("A" & Rows.Count).End(xlUp).Row
Sheet2.Select
For Each cell In Range("A1:A" & lr)
        If cell.Value = PartNum Then
        Range(Cells(cell.Row, "A"), Cells(cell.Row, "H")).Copy
        Sheet1.Range("A48").End(3)(2).PasteSpecial xlPasteValues
    End If
Next
Sheet1.Select
Sheet1.Range("J8") = ""
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
The "Fill Invoice" button is self explanatory. The code assigned to this button copies the part details from the data base in sheet2 via a drop down validation list in sheet1, cell J8 which lists the part numbers. Select a part number and click on the "Fill Invoice" button to extract the part number data.
The "Save and Clear" button saves the invoice to your selected file as a PDF. You will need to enter your required file path in the code (line 38 in the above code). It then clears the invoice and increments the invoice number ready for your next invoice. There are some explanatory notes in the test work book.
I hope that this at least gets you underway and hopefully in the right direction!
Cheerio,
vcoolio.
        
    
    
    
    
Jan 29, 2016 at 09:14 AM
I will try this out
I truly appreciate the feedback