PDA

View Full Version : Excel Data Tables



V.B.A.02
10-30-2017, 01:24 PM
Hello,

I am looking Some Excel help related to data tables in Excel....

I have a data table (say, MasterTable) in one Sheet in a workbook and another data table (say, SubTable) in another sheet in same workbook. Both tables have same columns.

SubTable contains all the data from MasterTable which has Status as "Active" in Status Column (This column contains values as "Active" and "InActive" only).

Data is added or edited in MasterTable only. I need SubTable to be refreshed or updated either on some button click or as soon as MasterTable is updated and saved.

I think I basically want some select query to run to show all fields where status is active.

any help is appreciated.

Thanks,

Logit
10-30-2017, 03:15 PM
.
This is one way :

Paste this macro in the sheet with MasterTable (change range as required) :



Option Explicit


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet2.Range("A1:D5").Value = ActiveSheet.Range("A1:D5").Value
End Sub

V.B.A.02
10-31-2017, 01:03 AM
Thanks Logit, however I am looking for something which works on connected tables and filters specific data as I mentioned I want only records with Active status.

Jan Karel Pieterse
10-31-2017, 06:14 AM
I would create a pivot table based off the master table with all fields of master table in the row area and the status field as page field. Then filter the page field for Active.
You could use the Activate event of the worksheet containing the PT to refresh the pivot table.