I'm trying to copy a column based on my drop down box

JGode

New Member
Joined
Jun 27, 2019
Messages
3
Hello,

I am trying to copy a column from Worksheet 2 to Worksheet 1 based on my drop down box on worksheet 1 which is made up of the column headers on worksheet 2.

My drop down box is on worksheet "Drawing Content" in cell B1 and the column headers are on worksheet "Master" and start in E1 and end AU1 but I'd like to potentially add more columns at a later date.

I am a beginner so any help is much appreciated!

Thank
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi & welcome to MrExcel.
Is your drop down a data validation drop down?
Also where on sheet1 do you want to copy the column?
 
Upvote 0
Hello,

Yes, it is a data validation drop down.
I'd like to copy the column to cell to B2

Thanks
 
Upvote 0
Ok, how about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   Dim Fnd As Range

   If Target.CountLarge > 1 Then Exit Sub
   If Target.Address(0, 0) = "B1" Then
      Set Fnd = Sheets("Master").Range("1:1").Find(Target.Value, , , xlWhole, , , False, , False)
      If Not Fnd Is Nothing Then
         Sheets("Master").Range(Fnd.Offset(1), Fnd.End(xlDown)).Copy Range("B2")
      End If
   End If
End Sub
This needs to go in the "Drawing Content" sheet module
 
Upvote 0
're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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