jessica116
New Member
- Joined
- Sep 29, 2020
- Messages
- 1
- Office Version
- 2016
- Platform
- Windows
Hi, I am working on a production schedule file. A company is producing batches of product and each batch goes through three different processes. Each color represents a new process and GP/SP/RP represents a different location of the batch. I am wanting to have excel generate in a column on the left hand side which GP/SP/RP is being used for the specific batch (hopefully with a function). See photo.
For example, Batch 1640 will have separate columns on the left hand side that state GP2, SP1, and RP12 are in use.
I have a function that I created to count the colors in a row and total them on the left hand side. This is what I am wanting but for the exact string name. Below I have pasted the count color function I created as reference.
Function countcolor(rangedata As Range, criteria As Range) As Long
Dim datax As Range
Dim xcolor As Long
xcolor = criteria.Interior.ColorIndex
For Each datax In rangedata
If datax.Interior.ColorIndex = xcolor Then
countcolor = countcolor + 1
End If
Next datax
End Function
For example, Batch 1640 will have separate columns on the left hand side that state GP2, SP1, and RP12 are in use.
I have a function that I created to count the colors in a row and total them on the left hand side. This is what I am wanting but for the exact string name. Below I have pasted the count color function I created as reference.
Function countcolor(rangedata As Range, criteria As Range) As Long
Dim datax As Range
Dim xcolor As Long
xcolor = criteria.Interior.ColorIndex
For Each datax In rangedata
If datax.Interior.ColorIndex = xcolor Then
countcolor = countcolor + 1
End If
Next datax
End Function