ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,731
- Office Version
- 2007
- Platform
- Windows
The code i have in use is shown below.
I am working with workbook DR & worksheet INV
I wish to copy some value & put them on another sheet.
The other workbook is MOTORCYCLES & the worksheet is INVOICES.
So far my code open the workbook in question, It then selects the correct worksheet & inserts a new row at Row 3
BUT now i see scubscript out of range.
Do you see an issue with my code & whilst there to save me starting a new post do you see any other issues.
Thansk
I am working with workbook DR & worksheet INV
I wish to copy some value & put them on another sheet.
The other workbook is MOTORCYCLES & the worksheet is INVOICES.
So far my code open the workbook in question, It then selects the correct worksheet & inserts a new row at Row 3
BUT now i see scubscript out of range.
Do you see an issue with my code & whilst there to save me starting a new post do you see any other issues.
Thansk
Rich (BB code):
Private Sub SendToBikeSheet_Click()
Dim answer As Long, wb As Workbook
answer = MsgBox("SEND VALUE'S TO BIKE WORKSHEET ?" & vbNewLine & "" & vbNewLine & "***** DO WE CONTINUE TO TRANSFER ? *****", vbYesNo + vbInformation, "BIKE TRANSFER QUESTION")
If answer = vbYes Then
Set wb = Workbooks.Open(fileName:="C:\Users\Ian\Desktop\REMOTES ETC\DR\EXCEL WORKSHEETS\MOTORCYCLES.xlsm")
Workbooks("MOTORCYCLES.xlsm").Sheets("INVOICES").Activate
ActiveSheet.Rows("3").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Workbooks("DR.xlsm").Sheets("INV").Range("G13").Copy ' CUSTOMERS NAME
wb.Sheets("MOTORCYCLES").Range("A3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("L16").Copy ' FRAME NUMBER
wb.Sheets("MOTORCYCLES").Range("B3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("L15").Copy ' REGISTRATION
wb.Sheets("MOTORCYCLES").Range("C3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("F32").Copy ' DATE OF JOB
wb.Sheets("MOTORCYCLES").Range("F3").PasteSpecial xlPasteValues
Workbooks("DR.xlsm").Sheets("INV").Range("F32").Copy ' INVOICE NUMBER
wb.Sheets("MOTORCYCLES").Range("G3").PasteSpecial xlPasteValues
wb.Close True
Else
Exit Sub
End If
Workbooks("DR.xlsm").Sheets("INV").Range("G13").Select
Application.CutCopyMode = False
MsgBox "BIKE TRANSFER COMPLETED", vbInformation, "SUCCESSFUL MESSAGE"
ActiveWorkbook.Save
End Sub