mummbles74
Board Regular
- Joined
- Nov 14, 2009
- Messages
- 120
- Office Version
- 365
- Platform
- Windows
I have only ever done code on a mac before and wrote this code for an Invoice generation program. I am now using a windows laptop and can't seem to get it to work. Can anyone see any issues?
Sub Create_invoice()
Dim wb As Workbook
Dim wb2 As Workbook
counter = Range("B26") + 1
Workbooks("create invoice.xls").Activate
Range("a2:a10").Select
Selection.Copy
Workbooks("blank invoice.xls").Activate
Range("a10").Select
Selection.PasteSpecial paste:=xlValues
Application.CutCopyMode = False
Workbooks("create invoice.xls").Activate
Range("a13:a23").Select
Selection.Copy
Workbooks("blank invoice.xls").Activate
Range("a20").Select
Selection.PasteSpecial paste:=xlValues
Application.CutCopyMode = False
Workbooks("create invoice.xls").Activate
Range("e13:e23").Select
Selection.Copy
Workbooks("blank invoice.xls").Activate
Range("g20").Select
Selection.PasteSpecial paste:=xlValues
Application.CutCopyMode = False
Range("g8").Select
Selection = counter
'Workbooks("create invoice.xls").Activate
'Range("b26").Select
'Selection = counter
Workbooks("blank invoice.xls").SaveAs Filename:="invoice " & Range("g8").Value & ""
'ActiveWorkbook.PrintOut Copies:=1, Collate:=True
'ActiveWorkbook.SaveAs "C:\Any Folder\" & Range("A1").Value & ".xls"
answer = MsgBox("Do you want to print ?", vbYesNo)
If answer = vbYes Then Print_sheet
If answer = vbNo Then
End If
Workbooks("create invoice.xls").Activate
Range("b26").Select
Selection = counter
End Sub
Appreciate the help in advance
Sub Create_invoice()
Dim wb As Workbook
Dim wb2 As Workbook
counter = Range("B26") + 1
Workbooks("create invoice.xls").Activate
Range("a2:a10").Select
Selection.Copy
Workbooks("blank invoice.xls").Activate
Range("a10").Select
Selection.PasteSpecial paste:=xlValues
Application.CutCopyMode = False
Workbooks("create invoice.xls").Activate
Range("a13:a23").Select
Selection.Copy
Workbooks("blank invoice.xls").Activate
Range("a20").Select
Selection.PasteSpecial paste:=xlValues
Application.CutCopyMode = False
Workbooks("create invoice.xls").Activate
Range("e13:e23").Select
Selection.Copy
Workbooks("blank invoice.xls").Activate
Range("g20").Select
Selection.PasteSpecial paste:=xlValues
Application.CutCopyMode = False
Range("g8").Select
Selection = counter
'Workbooks("create invoice.xls").Activate
'Range("b26").Select
'Selection = counter
Workbooks("blank invoice.xls").SaveAs Filename:="invoice " & Range("g8").Value & ""
'ActiveWorkbook.PrintOut Copies:=1, Collate:=True
'ActiveWorkbook.SaveAs "C:\Any Folder\" & Range("A1").Value & ".xls"
answer = MsgBox("Do you want to print ?", vbYesNo)
If answer = vbYes Then Print_sheet
If answer = vbNo Then
End If
Workbooks("create invoice.xls").Activate
Range("b26").Select
Selection = counter
End Sub
Appreciate the help in advance