VBA Code - Compare and copy data to another sheet

Aquila

New Member
Joined
Feb 15, 2021
Messages
1
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Afternoon all
First time poster so I m hoping you can help me out.

I have a spreadsheet and I need the Command Button to do the following

1. Create a new Sheet with a DATE as the Tab title
2. Copy the NEW Stock on Hand to the SOH sheet from the Order Sheet
3. clear the Order sheet for use the next day.

I've got the Date and Clearing of the sheet part down pat, but I need it to look at the SHEET "Order Sheet, Compare the Number in cells A4 to A27 to the data in the SOH sheet Cells A2 through to A69 and then when matched the total Quantity from the matched A column number to the SOH sheet Column C.

I hope that makes sense….

Here is what I have


Hope someone can help me out if possible
 

Attachments

  • Code so far.PNG
    Code so far.PNG
    17.9 KB · Views: 5
  • Order Sheet.PNG
    Order Sheet.PNG
    67.9 KB · Views: 5
  • SOH Sheet.PNG
    SOH Sheet.PNG
    94 KB · Views: 5

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
10,238
It is hard to work with pictures. It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach a screenshot (not a picture) of both sheets. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 

Watch MrExcel Video

Forum statistics

Threads
1,126,956
Messages
5,621,816
Members
415,857
Latest member
braunReivn

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
Top