Copy & paste values in a variable range to another worksheet using a vlookup to find variable rows to paste into

mf0u1098

New Member
Joined
Feb 6, 2013
Messages
4
Hi all, I hope you can help me.


I have 2 worksheets: LineRegister and OrderSummary.

The LineRegister sheet has details of all orders line by line in sequence. Each order can have any number of lines but the number of columns never changes.

e.g. (it has many more columns but just to show you)
[TABLE="width: 500"]
<TBODY>[TR]
[TD]Order Number
[/TD]
[TD]Order Line Number
[/TD]
[TD]Dispatch Quantity
[/TD]
[TD]Dispatch Date
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]1
[/TD]
[TD]1
[/TD]
[TD]12/02/13
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]12/02/13
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]3
[/TD]
[TD]1
[/TD]
[TD]12/02/13
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]1
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]2
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]3
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]1
[/TD]
[TD]1
[/TD]
[TD]13/02/13
[/TD]
[/TR]
</TBODY>[/TABLE]


The OrderSummary (is like the above but has only the information for 1 order displayed at each time) allows the user to pull up the relevant information about a particular order but I also want them to be able to input the dispatch data and use a macro to copy and paste this to the relevant lines for the order in the LineRegister. The problem is that the order can have 3 rows or 10 rows or 100 but I've managed to work out the row start and end points from the Order Number column so I know the range to paste (it will vary for each order though so must be able to reference a cell detailing the actual range). Next I need to lookup that order in the LineRegister and then copy and paste this dispatch information into the relevant cells.

So, for the above table, the user would bring up the details for just order 7 in the OrderSummary and now wants to dispatch the products. They would key in the quantities and dates. I then want this to go to the relevant cells (in the above example: C5 to D8 - it cannot copy paste onto the entire columns as this would wipe any dispatch info for any other order). I have found a way to automatically find the start and end rows of an order so is there any way to use this to do what I need it to?

Sorry if it's a bit wordy or I haven't made sense!

Thanks, Jemma x
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top