Write data back to data sheet

VbaHell

Well-known Member
Joined
Jan 30, 2011
Messages
1,220
Hello all

I think this maybe a big ask but here goes.

The code below looks at the values in the sheet called "Data" and using filters shows the filtered detail on the sheet called "Dashboard"

It is possible please to enter values in the Dashboard sheet that will write back to the Data sheet if that makes sense.

Code:
Sub CopyFltr()
    Dim Rws As Worksheet, Dws As Worksheet
    Dim Ary As Variant
    Dim LR As Long
    
    Application.EnableEvents = False
       
    Sheets("DashBoard").Range("C13:V1048576").ClearContents
    
    Set Rws = Sheets("DashBoard")
    Set Dws = Sheets("Data")
    Ary = Array(Rws.Range("D6"), 2, Rws.Range("D7"), 3, Rws.Range("D8"), 18, Rws.Range("D9"), 19, Rws.Range("F6"), 5, Rws.Range("F7"), 12, Rws.Range("F8"), 13, Rws.Range("F9"), 17)
    If Dws.AutoFilterMode Then Dws.AutoFilterMode = False
    With Dws.Range("A1:V1")
      If Ary(0) <> "" Then .AutoFilter Ary(1), Ary(0)
      If Ary(2) <> "" Then .AutoFilter Ary(3), Ary(2)
      If Ary(4) <> "" Then .AutoFilter Ary(5), Ary(4)
      If Ary(6) <> "" Then .AutoFilter Ary(7), Ary(6)
      If Ary(8) <> "" Then .AutoFilter Ary(9), Ary(8)
      If Ary(10) <> "" Then .AutoFilter Ary(11), Ary(10)
      If Ary(12) <> "" Then .AutoFilter Ary(13), Ary(12)
      If Ary(14) <> "" Then .AutoFilter Ary(15), Ary(14)
      
      .Parent.AutoFilter.Range.Offset(1).Copy Rws.Range("C" & Rows.Count).End(xlUp).Offset(1)
    End With
    Dws.AutoFilterMode = False

        

    Application.EnableEvents = True
End Sub
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,213,497
Messages
6,114,002
Members
448,543
Latest member
MartinLarkin

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