May 22 2024 10:02 PM
I have been given a task to create an inventory sheet for my place of work. For my inventory task, I have completed the inventory by building. I also need to create a separate inventory sheet by category as well. I was wondering if it would be possible to use the drop-down menu to automatically add a row to a new worksheet?
For instance, I have 10 scissors in the East Building. This is office supplies. Could I use a dropdown menu to designate this as office supplies and have the row with scissors be automatically added to another workbook designated to office supplies? The row also included info like cost, link to where to buy, etc. I am hoping that this is a possibility, and that if we update the original workbook to reflect a different number of scissors the office supply workbook would be updated as well. I am new to excel and am having difficulty finding which formulas would work best for this scenario
May 25 2024 11:47 PM
SolutionYou can achieve this by using Excel's built-in features such as data validation for the dropdown menu, along with a combination of formulas (like FILTER or VLOOKUP) and possibly some VBA for more advanced automation.
Here is a step-by-step guide on how you can set this up:
Step 1: Setting Up the Inventory Sheet with a Dropdown Menu
Step 2: Creating a New Worksheet for Each Category
=FILTER(Inventory!A:F, Inventory!C:C="Office Supplies")
Step 3: Automating Updates with VBA (Optional)
For more advanced automation, especially if you want rows to be automatically added to a new worksheet as you update the dropdown, you might need to use VBA.
Vba Code is untested, please backup your file.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
Dim srcSheet As Worksheet
Dim rng As Range
Dim lastRow As Long
Dim category As String
Dim destSheet As Worksheet
Set srcSheet = ThisWorkbook.Sheets("Inventory") ' Change "Inventory" to your sheet name
If Not Intersect(Target, srcSheet.Range("C:C")) Is Nothing Then
Application.EnableEvents = False
' Define the range to copy (entire row)
Set rng = srcSheet.Rows(Target.Row)
' Get the category
category = Target.Value
' Set the destination sheet based on the category
On Error Resume Next
Set destSheet = ThisWorkbook.Sheets(category)
On Error GoTo 0
If Not destSheet Is Nothing Then
' Find the next empty row in the destination sheet
lastRow = destSheet.Cells(destSheet.Rows.Count, "A").End(xlUp).Row + 1
' Copy the range to the destination sheet
rng.Copy
destSheet.Rows(lastRow).PasteSpecial Paste:=xlPasteValues
' Clear the clipboard
Application.CutCopyMode = False
End If
Application.EnableEvents = True
End If
End Sub
Step 4: Keeping Data Synced
To ensure updates in the main inventory sheet reflect in the category sheets:
Conclusion
By combining data validation, formulas, and potentially VBA, you can create an automated and dynamic inventory management system that categorizes items based on dropdown selections and updates corresponding sheets accordingly. This approach helps in keeping your data organized and up-to-date across multiple sheets. The text, steps and vba code were created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and Like it!
This will help all forum participants.
May 25 2024 11:47 PM
SolutionYou can achieve this by using Excel's built-in features such as data validation for the dropdown menu, along with a combination of formulas (like FILTER or VLOOKUP) and possibly some VBA for more advanced automation.
Here is a step-by-step guide on how you can set this up:
Step 1: Setting Up the Inventory Sheet with a Dropdown Menu
Step 2: Creating a New Worksheet for Each Category
=FILTER(Inventory!A:F, Inventory!C:C="Office Supplies")
Step 3: Automating Updates with VBA (Optional)
For more advanced automation, especially if you want rows to be automatically added to a new worksheet as you update the dropdown, you might need to use VBA.
Vba Code is untested, please backup your file.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
Dim srcSheet As Worksheet
Dim rng As Range
Dim lastRow As Long
Dim category As String
Dim destSheet As Worksheet
Set srcSheet = ThisWorkbook.Sheets("Inventory") ' Change "Inventory" to your sheet name
If Not Intersect(Target, srcSheet.Range("C:C")) Is Nothing Then
Application.EnableEvents = False
' Define the range to copy (entire row)
Set rng = srcSheet.Rows(Target.Row)
' Get the category
category = Target.Value
' Set the destination sheet based on the category
On Error Resume Next
Set destSheet = ThisWorkbook.Sheets(category)
On Error GoTo 0
If Not destSheet Is Nothing Then
' Find the next empty row in the destination sheet
lastRow = destSheet.Cells(destSheet.Rows.Count, "A").End(xlUp).Row + 1
' Copy the range to the destination sheet
rng.Copy
destSheet.Rows(lastRow).PasteSpecial Paste:=xlPasteValues
' Clear the clipboard
Application.CutCopyMode = False
End If
Application.EnableEvents = True
End If
End Sub
Step 4: Keeping Data Synced
To ensure updates in the main inventory sheet reflect in the category sheets:
Conclusion
By combining data validation, formulas, and potentially VBA, you can create an automated and dynamic inventory management system that categorizes items based on dropdown selections and updates corresponding sheets accordingly. This approach helps in keeping your data organized and up-to-date across multiple sheets. The text, steps and vba code were created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and Like it!
This will help all forum participants.