Excel invoice - source file and client file

Zef05

New Member
Joined
Oct 21, 2016
Messages
10
Hi!

I was able to create an invoicing excel file because of the help of all you awesome people from this forum.
But I would like some help again. Please don't hate me if I am confusing, since I am confusing my self too, with what I want to happen.

So is it possible to like

Source File.xlsm>Sheet1>A1 <------ Where the invoice number is
Client File A.xlsm>sheet1>A1 <------ Invoice Number from (Source File.xlsm>Sheet1>A1) + 1 when I click my Export Button (Saves as PDF and save to clients respective folder)


This is the current code I have:

Sub Rectangle1_Click()
Dim sFullName As String
Dim Ans As Long
Dim bSavePDF As Boolean
Worksheets("INV#").Range("A1").Value = Worksheets("INV#").Range("A1").Value + 1
sFullName = "C:\Invoice\Client A" & Range("A2").Value
Do

If Len(Dir(sFullName, vbNormal)) = 0 Then
bSavePDF = True
Else
Ans = MsgBox("File already exists. Overwirte?", vbQuestion + vbYesNoCancel, "Overwrite?")
Select Case Ans
Case vbYes
bSavePDF = True
Case vbNo
sFullName = Application.GetSaveAsFilename(InitialFileName:=sFullName, _
FileFilter:="PDF (*.pdf), *.pdf", Title:="Save As", ButtonText:="Save")
If sFullName = "False" Then Exit Sub
Case vbCancel
Exit Sub
End Select
End If
Loop Until bSavePDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sFullName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub




I really hope I did not confuse you or make you guys mad.
Thank you in advance!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,225,750
Messages
6,186,805
Members
453,373
Latest member
Ereha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top