JOSTERBAUER
Board Regular
- Joined
- Jan 17, 2005
- Messages
- 101
I have this macro up and running, but it will not open the original workbook back up after I run the macro. This is the function I can not get to finish with (Workbooks.Open Filename:= _
"C:\PDF FILES\INVOICE TRACKER\Invoice.Xls" )
Can anyone help me with this. You have been great with the other posts I have. This forum is great.
Sub Newjob()
Dim x As String
Dim cell As String
Dim counter As Integer
Dim Invoicenum As String
Dim Name As String
Dim amount As String
Invoicenum = Range("D5")
Name = Range("A10")
amount = Range("d35")
If Name <> "" Then
Workbooks.Open Filename:= _
"C:\PDF FILES\INVOICE TRACKER\Invoice tracker.Xls"
Sheets("2005 INVOICES").Select
Range("A2").Activate
For counter = 1 To 200
If "" = ActiveCell.Value Then
ActiveCell.Value = Invoicenum
cell = "A" & ActiveCell.Row
Range(cell).Offset(0, 1).Value = Name
Range(cell).Offset(0, 2).Value = Date
Range(cell).Offset(0, 7).Value = amount
GoTo escape1
Else: cell = "A" & ActiveCell.Row + 1
Range(cell).Activate
End If
Next
escape1:
End If
ActiveWorkbook.Save
ActiveWorkbook.Close
ChDir "C:\PDF FILES\INVOICE TRACKER\INVOICES"
ActiveWorkbook.SaveAs Range("D5")
ActiveWorkbook.Close
ActiveWorkbook.Save
'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Workbooks.Open Filename:= _
"C:\PDF FILES\INVOICE TRACKER\Invoice.Xls"
End Sub
"C:\PDF FILES\INVOICE TRACKER\Invoice.Xls" )
Can anyone help me with this. You have been great with the other posts I have. This forum is great.
Sub Newjob()
Dim x As String
Dim cell As String
Dim counter As Integer
Dim Invoicenum As String
Dim Name As String
Dim amount As String
Invoicenum = Range("D5")
Name = Range("A10")
amount = Range("d35")
If Name <> "" Then
Workbooks.Open Filename:= _
"C:\PDF FILES\INVOICE TRACKER\Invoice tracker.Xls"
Sheets("2005 INVOICES").Select
Range("A2").Activate
For counter = 1 To 200
If "" = ActiveCell.Value Then
ActiveCell.Value = Invoicenum
cell = "A" & ActiveCell.Row
Range(cell).Offset(0, 1).Value = Name
Range(cell).Offset(0, 2).Value = Date
Range(cell).Offset(0, 7).Value = amount
GoTo escape1
Else: cell = "A" & ActiveCell.Row + 1
Range(cell).Activate
End If
Next
escape1:
End If
ActiveWorkbook.Save
ActiveWorkbook.Close
ChDir "C:\PDF FILES\INVOICE TRACKER\INVOICES"
ActiveWorkbook.SaveAs Range("D5")
ActiveWorkbook.Close
ActiveWorkbook.Save
'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Workbooks.Open Filename:= _
"C:\PDF FILES\INVOICE TRACKER\Invoice.Xls"
End Sub