Hello,
Question 1:
I have a table which filtered using excel slicers. The table contains helper columns which aid in the filtering process but I do not want to copy and paste to a new sheet.
My macro copies the entire table including the undesired helper columns.
>>> use code - tags <<<
How do I edit my macro to only copy Column A:L of the table in the RawData sheet and not my helper M:Q columns.
Question 2
Instead of a button to click to execute my macro. How can I execute the macro automatically after I make my 2nd selection in the excel slicers for the table. Please see attached excel file for what I am trying to achieve.
Best,
Francis
Question 1:
I have a table which filtered using excel slicers. The table contains helper columns which aid in the filtering process but I do not want to copy and paste to a new sheet.
My macro copies the entire table including the undesired helper columns.
>>> use code - tags <<<
Code:
Sub CopyFilteredInstrumentData()
Dim rng As Range
Dim WS As Worksheet
For Each Row In Range("Table1[#All]").Rows
If Row.EntireRow.Hidden = False Then
If rng Is Nothing Then Set rng = Row
Set rng = Union(Row, rng)
End If
Next Row
Set WS = ThisWorkbook.Worksheets("Master")
rng.Copy Destination:=WS.Range("D7")
End Sub
How do I edit my macro to only copy Column A:L of the table in the RawData sheet and not my helper M:Q columns.
Question 2
Instead of a button to click to execute my macro. How can I execute the macro automatically after I make my 2nd selection in the excel slicers for the table. Please see attached excel file for what I am trying to achieve.
Best,
Francis
Attachments
Last edited by a moderator: