Macro to copy column based on header list selection from Worksheet1 into relevant column of Worksheet2

GrantG3SA

New Member
Joined
Dec 23, 2019
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hello,
I need help using a macro button to copy column data based on a dropdown list selection from worksheet1 into worksheet2 where the column in worksheet 2 equals the dropdown list selection. The use is where I have multiple sales people using a shared workbook to enter orders on worksheet1 for each customer which collates onto one sheet for my factory guys to see one consolidated list of orders for all customers.

1st Sheet below is titled Entry where my sales guys select the entries under Managed which filters Region which filters Store. Once they have the store they enter the orders for the store and I want them to then select Save. The Save button must run the macro to take the values entered under the store name (in this case Earlymoon) and enter it under the relevant column in the second worksheet called Orders. There are 58 rows in the entry worksheet and columns going to BM in the orders worksheet. I pasted a small subset below and will then expand as needed.
1577122906020.png
1577122884741.png


Any advice would be welcomed.
thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi All,
I have managed to get a SAVE button in and coded to update a specific range in the Orders sheet. Looking for advice on how to make the pointing of the range dependent on the Store name. So the range in the Orders sheet (2nd screen paste) must move columns dependent on the name under Store in the Entry sheet (1st screen paste).

Sub SAVE()
Worksheets("Orders").Range("C6:C58").Value = Worksheets("Entry").Range("C3:C55").Value
End Sub
 
Upvote 0
I'm making good progress but stuck with the variable of the pointing to the second sheet....

My code below now finds the values in the range, But I don't know how to say its now column E so write to that column and not column C. I bolded the issue below...
Sub SAVE()
Dim Store As String

'Set Store to Cell C2 from worksheet Entry
Store = Range("C2").Value
'Look for Store in Worksheet Orders to obtain range to copy to
If Not IsError(Application.Match(Store, Sheets("Orders").Range("C3:H3"), 0)) Then

'Copy C3:C55 from Entry worksheet into found Range from Orders Worksheet
Worksheets("Orders").Range("C6:C58").Value = Worksheets("Entry").Range("C3:C55").Value

End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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