Copying Archived data from one sheet onto another based on a drop down selection

shauns

New Member
Joined
Feb 19, 2019
Messages
4
Hi Everyone,

I would like to copy data from the "Spreadsheet Archive" sheet intothe "Previous Visits" sheet depending on the station that is selectedfrom the drop down list in the "Input" sheet.

I assumed this was going to be a very simple step but my Excel skills arenot as strong as I thought. I have spent hours trying to solve this problem buthave not been able to figure it out. My VBA is very basic soI have tried to record the macro. The issue seems to bewith selecting the drop down cell and trying to paste it into afilter in the "Spreadsheet Archive" sheet.

There is already a macro that alters the data entry cells onthe "Input" sheet depending on the site that isselected from the drop down menu. Ideally I would likethe "Previous Visits" tab to be populatedautomatically with any data in the "Spreadsheet Archive" sheetthat contains the station name selected in the "Input" tab.However because there is already a macro that executes itself when astation is chosen would it be easier to have the archived data retrieved usinga button instead.

Any help with this would be massively appreciated. I am reallystruggling.

I have included a copy of the spreadsheet here: https://www.dropbox.com/s/cgd2iygkf8kizzy/Site%20data%20entry.xlsm?dl=0

Hopefully my query makes sense when you look at the file.

Thank you in advance.

Shaun


 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   If Target.Address = "$B$2" Then
      If Target <> "" Then
         Sheet12.Rows("2:" & Rows.Count).ClearContents
         With Sheet11
            If Application.CountIf(.Range("A:A"), Target) > 0 Then
               If .FilterMode Then .ShowAllData
               .Range("A2:S2").AutoFilter 1, Target
               .AutoFilter.Range.Offset(1).Copy Sheet12.Range("A2")
               .ShowAllData
            End If
         End With
         Call show_Required_rows
      End If
    End If
End Sub
 
Upvote 0
Thankyou so much!!!! It works. I never saw any hints or tips that looked remotely like that or offered such a great way to do it!!

You have absolutely made my day!
 
Last edited by a moderator:
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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