ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,731
- Office Version
- 2007
- Platform
- Windows
Hi,
In my call function which at present doesnt work i keep seeing an error SUBSCRIPT OUT OF RANGE.
The function should open another worksheet etc but im missing a piece of code to do so.
Do you see the issue here
Thanks
In my call function which at present doesnt work i keep seeing an error SUBSCRIPT OUT OF RANGE.
The function should open another worksheet etc but im missing a piece of code to do so.
Do you see the issue here
Thanks
Rich (BB code):
Sub BIKETRANSFERINFO()
'BIKE INFOR SENT FRON INV SHEET TO BIKE INVOICES
Dim WB As Workbook
With Sheets("INVOICES")
Dim x As Long
Application.ScreenUpdating = False
Workbooks.Open ("C:\Users\Ian\Desktop\REMOTES ETC\DR\EXCEL WORKSHEETS\MOTORCYCLES.xlsm")
Worksheets("INVOICES").Activate
Worksheets("INVOICES").Rows("3:3").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveWorkbook.Close SaveChanges:=True
Set WB = Workbooks.Open(fileName:="C:\Users\Ian\Desktop\REMOTES ETC\DR\EXCEL WORKSHEETS\MOTORCYCLES.xlsm")
Workbooks("DR.xlsm").Sheets("INV").Range("G13").Copy
WB.Sheets("INVOICES").Range("A3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("L16").Copy
WB.Sheets("INVOICES").Range("B3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("L15").Copy
WB.Sheets("INVOICES").Range("C3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("O14").Copy
WB.Sheets("INVOICES").Range("D3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("O17").Copy
WB.Sheets("INVOICES").Range("E3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("L13").Copy
WB.Sheets("INVOICES").Range("F3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("L4").Copy
WB.Sheets("INVOICES").Range("G3").PasteSpecial xlPasteValues
With Sheets("INVOICES")
If .AutoFilterMode Then .AutoFilterMode = False
x = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("A1:G" & x).Sort Key1:=.Range("A1"), Order1:=xlAscending, Header:=xlYes, DataOption1:=xlSortTextAsNumbers
Range("A3").Select
End With
WB.Close True
End With
End Sub