Production Report to Itemize Each Part Number with Summary

Billy Hill

Board Regular
Joined
Dec 21, 2010
Messages
73
I have a production report that has the goals and total units made for 3 shifts. I summarize each part number for easy reading with the totals. The results can be an image or data.

My source data looks like this:

Screenshot 2023-03-24 095513.png


And I want the results to look like this with all the part numbers, (an image of the summaries is fine, I will be emailing it to the owner for review)

1679677159224.png


Is there a way to automate this in VBA?

TYIA!

~B
 
You have the macro in the workbook "PERSONAL.XLSB", so thisWorkbook refers to the workbook "PERSONAL.XLSB".

1680537912911.png



To refer to another workbook you must put the name of the other workbook, for example:

Try updating the following lines in your code:

Rich (BB code):
Sub CreateSummaryTable()
  Dim wsSource As Worksheet
  Dim wsSummary As Worksheet
  Dim partNumber As String
  Dim lastRow As Long
  Dim rngPartData As Range
  Dim rngSummary As Range
  Dim chartObj As ChartObject
  
  Dim wb2 As Workbook
  Set wb2 = Workbooks("SHOP PRODUCTION ANALYSIS.xlsx")
  'Set the source worksheet
  Set wsSource = wb2.Sheets("DAILY PRODUCTION REPORT")

  'Create a new worksheet for the summary tables
  Set wsSummary = wb2.Sheets.Add(After:=wsSource)
  wsSummary.Name = "Summary"
  '
  '....

End Sub
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,224,847
Messages
6,181,324
Members
453,032
Latest member
Pauh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top