On the Line # tab, I would like all of the information from the ISO Entry tab relisted where any lines that have the same Area Code, Plan Code, System Code, Pipe Size, and Insulation Thickness; The information under Straight Pipe, 90's/45's, Misc, Valves, Flanges is summed up and shown as 1 line item instead of multiple line items.
On the Pipe Size tab, I would like the information listed where any line that has the same Pipe Size and Insulation Thickness; The information under Straight Pipe, 90's/45's, Misc, Valves, Flanges is summed up and shown as 1 line item instead of multiple line items.
Let me know if you have any questions and thanks for the help!
Sub Demo1() Dim C, N%, R&, K$, V C = [{0,0,0;"A:E","A:J","G:K";"D:E","D:J","D:H"}] For N = 2 To 3 Worksheets(N).Cells(1).Value = "¤" Worksheets(N).UsedRange.Offset(1).Clear Next Application.ScreenUpdating = False With Worksheets(1).UsedRange.Rows For R = 2 To .Count For N = 2 To 3 K = Join(Application.Index(.Item(R).Columns(C(N, 1)).Value, 1, 0), "¤") V = Application.Match(K, Worksheets(N).UsedRange.Columns(1), 0) If IsError(V) Then V = Worksheets(N).UsedRange.Rows.Count + 1 Worksheets(N).Cells(V, 1).Value = K .Item(R).Columns(C(N, 2)).Copy Worksheets(N).Cells(V, 2) Else K = Worksheets(N).UsedRange.Rows(V).Columns(C(N, 3)).Address(External:=True) Range(K).Value = Evaluate(.Item(R).Columns("F:J").Address(External:=True) & "+" & K) End If Next Next End With Worksheets(2).UsedRange.Columns(1).Clear Worksheets(3).UsedRange.Columns(1).Clear Application.ScreenUpdating = True End Sub
Do you like it ? So thanks to click on bottom left star icon « ★ Add Reputation » !
Good Luck
I don't presume to know what I am doing, however, just like you, I too started somewhere...
One-day, One-problem at a time!!!
If you feel I have helped, please click on the star to left of post [Add Reputation]
Also....add a comment if you like!!!!
And remember...Mark Thread as Solved.
Excel Forum Rocks!!!
sintek your code well works but to avoid duplicates it needs to manually clear the result worksheets before running it …
A variation of my previous code using Collections (as Dictionary) instead of columns to store keys :
PHP Code:
Sub Demo2() Dim C, R&, N%, K$, Dic(2 To 3) As New Collection C = [{0,0,0;"A:E","A:J","F:J";"D:E","D:J","C:G"}] Worksheets(2).UsedRange.Offset(1).Clear Worksheets(3).UsedRange.Offset(1).Clear Application.ScreenUpdating = False On Error Resume Next With Worksheets(1).UsedRange.Rows For R = 2 To .Count For N = 2 To 3 K = Join(Application.Index(.Item(R).Columns(C(N, 1)).Value, 1, 0), "¤") Dic(N).Add Dic(N).Count + 2, K If Err.Number Then K = Worksheets(N).UsedRange.Rows(Dic(N)(K)).Columns(C(N, 3)).Address(External:=True) Range(K).Value = Evaluate(.Item(R).Columns("F:J").Address(External:=True) & "+" & K) Err.Clear Else .Item(R).Columns(C(N, 2)).Copy Worksheets(N).Cells(Dic(N).Count + 1, 2) End If Next Next End With Erase Dic Application.ScreenUpdating = True End Sub
Do you like it ? So thanks to click on bottom left star icon « ★ Add Reputation » !
Thanks! I have a second spreadsheet that I was hoping you could help with. Same idea as this spreadsheet; only the ISO Entry tab has a different way of displaying information. See attached.
On the ISO tab, the row that looks like this "3"-SC2500-Q-CS02-2" is the Line Number. Everything above that is the information for that line number.
The Line Number tells us 4 things. Area Code, Plan Code, System Code, and Insulation Thickness. I would like an entry table to be able to tell the program where each of those are located in the Line Number.
Example:
Area Code = Q or A or etc.
Plan Code = SC or SH or CW or etc.
System Code = 2554 or 2835 or etc.
Insulation thickness = First number from the right (so 2" in above Line Number - or sometimes it will say 2EG at the end where 2 is still the thickness)
If the value under the "Size" column is "#x#", then I would like it displayed as the larger number.
For the columns 90s, Misc, Valves, Flanges, 45s - you will need to search for keywords under the Description Column on ISO tab. I would like a table where I can tell the program what to look for under each. Up to 10 different words under each column.
I would like 1 more entry table where I can Enter in the Plan Code and then enter in a color, and all of those lines are then highlighted that color. EX: CW = Blue
Bookmarks