May 06 2024 10:12 AM
I'm looking for some help finding a way to automatically generate tables from a list of entries with multiple data points. For context, we use Excel to create a bill of materials table which we then link to a table in an AutoCAD .dwg file for our design drawings. Right now I have a separate Excel file set up with a long list of all the parts we commonly use, with one row per part, and each column has data like catalog number, description, power rating, temperature rating, heat loss, etc. (some columns are formatted for text, some are for numbers). I'll copy over the manufacturer, part number, and description cells from the data file to the BOM file, then tell AutoCAD to link the relevant cells.
I want to expand the functionality of this table. What I imagine the high-level description to be is this:
We're familiar with most basic functions in Excel, but not in the ways of indexing. Any advice on functions to use and how to use them would be appreciated. Thanks, all!
May 07 2024 11:10 PM
SolutionTo achieve the functionality you described in Excel, you will need to use a combination of formulas, such as VLOOKUP, INDEX-MATCH, and SUMIF, along with some basic VBA (Visual Basic for Applications) coding for automation. Here is a step-by-step guide on how to set up your Excel workbook to automatically generate tables from a list of entries:
Here is a simplified example of the VBA code to get you started:
Vba code is untested, please backup your file first.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim newRow As Range
Dim lastRow As Long
' Check if changes were made in Sheet 1
If Not Intersect(Target, Me.Range("A:A")) Is Nothing Then
' Find the last row with data in Sheet 1
lastRow = Me.Cells(Me.Rows.Count, "A").End(xlUp).Row
' Loop through the new rows
For Each newRow In Target.Rows
' Extract relevant information and populate Sheets 2, 3, and 4
' Example:
' Sheets("Sheet2").Cells(lastRow, 1).Value = newRow.Cells(1, 1).Value ' ID number
' Sheets("Sheet2").Cells(lastRow, 2).Value = newRow.Cells(1, 2).Value ' Quantity
' ...
' Increment lastRow for next iteration
lastRow = lastRow + 1
Next newRow
End If
End Sub
NOTE: My knowledge of this topic is limited, but since no one has answered it for at least one day or more, I entered your question in various AI. The text,Steps and code were created with the help of AI. Maybe it will help you further in your project, if not please just ignore it.
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 07 2024 11:30 PM
As variant you may use Power Query on all steps, starting from importing of data file to generating linked tables.
If you are on Excel 365 or 2021, dynamic arrays formulae could be used.
Details depends on which Excel platform/version you are, do you mean under tables structured Excel tables or ranges, etc.
It's better to discuss on small sample file which illustrates input and desired output.
May 07 2024 11:10 PM
SolutionTo achieve the functionality you described in Excel, you will need to use a combination of formulas, such as VLOOKUP, INDEX-MATCH, and SUMIF, along with some basic VBA (Visual Basic for Applications) coding for automation. Here is a step-by-step guide on how to set up your Excel workbook to automatically generate tables from a list of entries:
Here is a simplified example of the VBA code to get you started:
Vba code is untested, please backup your file first.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim newRow As Range
Dim lastRow As Long
' Check if changes were made in Sheet 1
If Not Intersect(Target, Me.Range("A:A")) Is Nothing Then
' Find the last row with data in Sheet 1
lastRow = Me.Cells(Me.Rows.Count, "A").End(xlUp).Row
' Loop through the new rows
For Each newRow In Target.Rows
' Extract relevant information and populate Sheets 2, 3, and 4
' Example:
' Sheets("Sheet2").Cells(lastRow, 1).Value = newRow.Cells(1, 1).Value ' ID number
' Sheets("Sheet2").Cells(lastRow, 2).Value = newRow.Cells(1, 2).Value ' Quantity
' ...
' Increment lastRow for next iteration
lastRow = lastRow + 1
Next newRow
End If
End Sub
NOTE: My knowledge of this topic is limited, but since no one has answered it for at least one day or more, I entered your question in various AI. The text,Steps and code were created with the help of AI. Maybe it will help you further in your project, if not please just ignore it.
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.