Populate Multiple Sheets Based on Data Entered in a Main Excel Sheet
On March 02,2023 by Tom RoutleyThis article will explain how you populate multiple excel sheets based on data entered in another main sheet.
Example
I'm making an accounting workbook with the following criteria:
In the first sheet called "Account", all the transactions will be listed on table that goes from C6-H6, and on down for every entry. One of the columns in the table is labeled "Sector" and refers to expenses or revenues sources. There are 7 sectors and they each have a sheet in this workbook.
What I would like to do, is have each individual sector's sheet automatically populate with data each time the Account" sheet is updated, and have it based on the Sector column in the table. So basically, if the sector says "General", I would like for the entire row to be transferred to the sheet called "General". And so on for each individual sector.
Solution
Note 1: The Sector is entered in column H.
Note 2: Enter the sector as the last value of the row.
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Columns("H:H")) Is Nothing Then Exit Sub Range(Range("C" & Target.Row), Range("H" & Target.Row)).Copy _ Sheets(Target.Value).Range("C" & Rows.Count).End(xlUp).Offset(1, 0) End Sub
To implement the code:
Right-click on the "Account" tab and select View code.
Paste the code in the big white field.
Thanks to TrowaD for this tip.
Photo: Unsplash
Article Recommendations
Latest articles
Popular Articles
Archives
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- January 2021
Leave a Reply