bloodmilksky
Board Regular
- Joined
- Feb 3, 2016
- Messages
- 202
Hi Guys, I was wondering if anyone can help.
I am trying to use the below to compile an order of different products. ideally what should happen is that it copies Range B7:D69 to sheet 1 and then you can add another group of products to the next empty row. but what is happening at the moment is that everytime you run it, it is just copying over the previous order. can anyone help please ?
any help would be greatly appreciated
Jamie
I am trying to use the below to compile an order of different products. ideally what should happen is that it copies Range B7:D69 to sheet 1 and then you can add another group of products to the next empty row. but what is happening at the moment is that everytime you run it, it is just copying over the previous order. can anyone help please ?
Code:
Sub OrderCopy()
Dim lRow As Long
Dim sRangeName As String
'Copy Cells B7 & D68 On Menu
Sheets("Menu").Range("B7:D68").Copy
'To A Range Defined in B5
sRangeName = Sheets("MENU").Range("B5").Value
'The range is on menu sheet and is the range defined on sheet1 "a1:d880"
'get next empty row in named range
lRow = 1
Do Until Sheets("Sheet1").Range(sRangeName).Cells(lRow, 1) = ""
lRow = lRow + 1
Loop
'Paste Data
Sheets("Sheet1").Range(sRangeName).Cells(lRow, 1).PasteSpecial xlPasteAll
End Sub
any help would be greatly appreciated
Jamie