Conflicting codes?

Mikal

Board Regular
Joined
Aug 31, 2015
Messages
73
I have code that puts data into columns depending on weather or not the check box is checked. I also have code that checks the value of the cell and re-checks the box if >0 I Can't seem to get both codes to work, whichever on I have first works but the other doesn't. If I switch the order then the other works. Any Ideas?
Code:
Purchased Component Costs
If CheckBox1.Value = True Then
   Cells(PartNumRow, 9).Value = Cells(PartNumRow, 2).Value
Else
   Cells(PartNumRow, 9).Value = 0
End If

If Cells(PartNumRow, 9).Value > 0 Then
    Cells(PartNumRow, 8).Value = 0
     
Else
   Cells(PartNumRow, 8).Value = Cells(PartNumRow, 7).Value
  
  End If
If Cells(PartNumRow, 9).Value > 0 Then
CheckBox1.Value = True
Else
CheckBox1.Value = False
End If
 
Last edited by a moderator:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Yes, There are 200+ lines of code that run when this happens
[CO
Private Sub CreateSubCom_Click()

'No code to add Part Number to worksheet Complete_Assy as it already appears. Data will change based on formulas.
Dim PartNumRow As String
'Make SubCom2 Active
Sheets("StartHereSubCom").ActivateDE][/CODE]
 
Upvote 0
I don't seem to be making any headway, can anyone tell me how to modify the code so that it does all the functions? Currently I can make it do one or the other depending on which one is first.
 
Upvote 0
How is the code being triggered?

Are the checkboxes connected to cells?

If they are does any of the code change those connected cells?
 
Upvote 0
There are calculations that happen and cells are filled with that data, however the checkbox determines where the data lives on the spreadsheet. If you look at 'purchase component costs, that is where I a trying to add this code.
Code:
[FONT=Calibri][SIZE=3][COLOR=#000000]If Cells(PartNumRow, 9).Value > 0 Then[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000]
[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]CheckBox1.Value = True[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000]
[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Else[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000]
[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]CheckBox1.Value = False[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000]
[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]End If[/COLOR][/SIZE][/FONT]


If I put it above 'purchase component costs, it works but the code for purchase component costs does not and vice versus.

The code below the trigger and everything that runs on that trigger.

Code:
Private Sub CreateSubCom_Click()

'No code to add Part Number to worksheet Complete_Assy as it already appears. Data will change based on formulas.
Dim PartNumRow As String
'Make SubCom2 Active
Sheets("StartHereSubCom").Activate
'Determine PartNumRow
'PartNumRow = Application.WorksheetFunction.Match(In_SubComPNmod2.Value, Worksheets("StartHereSubCom").Range("A1:A999"), 0)
PartNumRow = Application.WorksheetFunction.Match(In_SubComPNmod.Caption, Worksheets("StartHereSubCom").Range("A1:A999"), 0)
'MsgBox "Found Original PN at row : " & PartNumRow
'Export Data to worksheet
'Cells(PartNumRow, 1).Value = In_SubComPNmod.Caption
'Cells(PartNumRow, 2).Value =
'Cells(PartNumRow, 3).Value =
'Cells(PartNumRow, 4).Value =
Cells(PartNumRow, 6).Value = In_SubComDescribe.Value
Cells(PartNumRow, 15).Value = In_Material2.Value
Cells(PartNumRow, 16).Value = In_Quantity2.Value
Cells(PartNumRow, 20).Value = In_Units2.Value
Cells(PartNumRow, 17).Value = In_Material.Value
Cells(PartNumRow, 18).Value = In_Quantity.Value
Cells(PartNumRow, 19).Value = In_Units.Value
Cells(PartNumRow, 21).Value = In_CostPerUnit.Value
Cells(PartNumRow, 23).Value = In_CostPerUnit2.Value
Cells(PartNumRow, 26).Value = Combo_Task1.Value
Cells(PartNumRow, 27).Value = In_Time1.Value
Cells(PartNumRow, 30).Value = In_SetupFee1.Value
'Cells(PartNumRow, 31).Value = In_SetupApplied1.Value
Cells(PartNumRow, 32).Value = In_Tooling1.Value
Cells(PartNumRow, 33).Value = In_Notes1.Value
Cells(PartNumRow, 34).Value = Combo_Task2.Value
Cells(PartNumRow, 35).Value = In_Time2.Value
Cells(PartNumRow, 38).Value = In_SetupFee2.Value
'Cells(PartNumRow, 39).Value = In_SetupApplied2.Value
Cells(PartNumRow, 40).Value = In_Tooling2.Value
Cells(PartNumRow, 41).Value = In_Notes2.Value
Cells(PartNumRow, 42).Value = Combo_Task3.Value
Cells(PartNumRow, 43).Value = In_Time3.Value
Cells(PartNumRow, 46).Value = In_SetupFee3.Value
'Cells(PartNumRow, 47).Value = In_SetupApplied3.Value
Cells(PartNumRow, 48).Value = In_Tooling3.Value
Cells(PartNumRow, 49).Value = In_Notes3.Value
Cells(PartNumRow, 50).Value = Combo_Task4.Value
Cells(PartNumRow, 51).Value = In_Time4.Value
Cells(PartNumRow, 54).Value = In_SetupFee4.Value
'Cells(PartNumRow, 55).Value = In_SetupApplied4.Value
Cells(PartNumRow, 56).Value = In_Tooling4.Value
Cells(PartNumRow, 57).Value = In_Notes4.Value
Cells(PartNumRow, 58).Value = Combo_Task5.Value
Cells(PartNumRow, 59).Value = In_Time5.Value
Cells(PartNumRow, 62).Value = In_SetupFee5.Value
'Cells(PartNumRow, 63).Value = In_SetupApplied5.Value
Cells(PartNumRow, 64).Value = In_Tooling5.Value
Cells(PartNumRow, 65).Value = In_Notes5.Value
Cells(PartNumRow, 66).Value = Combo_Task6.Value
Cells(PartNumRow, 67).Value = In_Time6.Value
Cells(PartNumRow, 70).Value = In_SetupFee6.Value
'Cells(PartNumRow, 71).Value = In_SetupApplied6.Value
Cells(PartNumRow, 72).Value = In_Tooling6.Value
Cells(PartNumRow, 73).Value = In_Notes6.Value
Cells(PartNumRow, 74).Value = Combo_Task7.Value
Cells(PartNumRow, 75).Value = In_Time7.Value
Cells(PartNumRow, 78).Value = In_SetupFee7.Value
'Cells(PartNumRow, 79).Value = In_SetupApplied7.Value
Cells(PartNumRow, 80).Value = In_Tooling7.Value
Cells(PartNumRow, 81).Value = In_Notes7.Value
Cells(PartNumRow, 82).Value = Combo_Task8.Value
Cells(PartNumRow, 83).Value = In_Time8.Value
Cells(PartNumRow, 86).Value = In_SetupFee8.Value
'Cells(PartNumRow, 87).Value = In_SetupApplied8.Value
Cells(PartNumRow, 88).Value = In_Tooling8.Value
Cells(PartNumRow, 89).Value = In_Notes8.Value
Cells(PartNumRow, 90).Value = Combo_Task9.Value
Cells(PartNumRow, 91).Value = In_Time9.Value
Cells(PartNumRow, 94).Value = In_SetupFee9.Value
'Cells(PartNumRow, 95).Value = In_SetupApplied9.Value
Cells(PartNumRow, 96).Value = In_Tooling9.Value
Cells(PartNumRow, 97).Value = In_Notes9.Value
Cells(PartNumRow, 98).Value = Combo_Task10.Value
Cells(PartNumRow, 99).Value = In_Time10.Value
Cells(PartNumRow, 102).Value = In_SetupFee10.Value
'Cells(PartNumRow, 103).Value = In_SetupApplied10.Value
Cells(PartNumRow, 104).Value = In_Tooling10.Value
Cells(PartNumRow, 105).Value = In_Notes10.Value
Cells(PartNumRow, 106).Value = Combo_Task11.Value
Cells(PartNumRow, 107).Value = In_Time11.Value
Cells(PartNumRow, 110).Value = In_SetupFee11.Value
'Cells(PartNumRow, 111).Value = In_SetupApplied11.Value
Cells(PartNumRow, 112).Value = In_Tooling11.Value
Cells(PartNumRow, 113).Value = In_Notes11.Value
Cells(PartNumRow, 114).Value = Combo_Task12.Value
Cells(PartNumRow, 115).Value = In_Time12.Value
Cells(PartNumRow, 118).Value = In_SetupFee12.Value
'Cells(PartNumRow, 119).Value = In_SetupApplied12.Value
Cells(PartNumRow, 120).Value = In_Tooling12.Value
Cells(PartNumRow, 121).Value = In_Notes12.Value
Cells(PartNumRow, 122).Value = Combo_Task13.Value
Cells(PartNumRow, 123).Value = In_Time13.Value
Cells(PartNumRow, 126).Value = In_SetupFee13.Value
'Cells(PartNumRow, 127).Value = In_SetupApplied13.Value
Cells(PartNumRow, 128).Value = In_Tooling13.Value
Cells(PartNumRow, 129).Value = In_Notes13.Value
Cells(PartNumRow, 130).Value = Combo_Task14.Value
Cells(PartNumRow, 131).Value = In_Time14.Value
Cells(PartNumRow, 134).Value = In_SetupFee14.Value
'Cells(PartNumRow, 135).Value = In_SetupApplied14.Value
Cells(PartNumRow, 136).Value = In_Tooling14.Value
Cells(PartNumRow, 137).Value = In_Notes14.Value
Cells(PartNumRow, 138).Value = Combo_Task15.Value
Cells(PartNumRow, 139).Value = In_Time15.Value
Cells(PartNumRow, 142).Value = In_SetupFee15.Value
'Cells(PartNumRow, 143).Value = In_SetupApplied15.Value
Cells(PartNumRow, 144).Value = In_Tooling15.Value
Cells(PartNumRow, 145).Value = In_Notes15.Value

'Calculated Data Export to worksheet
    'Material Information
    'Cost per Part
   If Cells(PartNumRow, 18).Value > 0 Then
    Cells(PartNumRow, 22).Value = In_CostPerUnit.Value * Cells(PartNumRow, 18).Value
    Else
    Cells(PartNumRow, 22).Value = 0
    End If
'Cost per Part 2
   If Cells(PartNumRow, 16).Value > 0 Then
    Cells(PartNumRow, 24).Value = In_CostPerUnit2.Value * Cells(PartNumRow, 16).Value
    Else
    Cells(PartNumRow, 24).Value = 0
    End If
'Cost per Part Total
Cells(PartNumRow, 7).Value = Cells(PartNumRow, 24).Value + Cells(PartNumRow, 22).Value
    
'Task1 Information
    'Labor Rate1
    Cells(PartNumRow, 28).Value = Application.WorksheetFunction.VLookup(Combo_Task1.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge1
    Cells(PartNumRow, 29).Value = (Cells(PartNumRow, 28).Value / 60) * Cells(PartNumRow, 27).Value
       
'Task2 Information
    'Labor Rate2
    Cells(PartNumRow, 36).Value = Application.WorksheetFunction.VLookup(Combo_Task2.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge2                                    Labor Rate2                                      Time2
    Cells(PartNumRow, 37).Value = (Cells(PartNumRow, 36).Value / 60) * Cells(PartNumRow, 35).Value
     
    'Task3 Information
    'Labor Rate3
    Cells(PartNumRow, 44).Value = Application.WorksheetFunction.VLookup(Combo_Task3.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge3                                    Labor Rate3                                      Time3
    Cells(PartNumRow, 45).Value = (Cells(PartNumRow, 44).Value / 60) * Cells(PartNumRow, 43).Value
     
    'Task4 Information
    'Labor Rate4
    Cells(PartNumRow, 52).Value = Application.WorksheetFunction.VLookup(Combo_Task4.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge4                                    Labor Rate4                                      Time4
    Cells(PartNumRow, 53).Value = (Cells(PartNumRow, 52).Value / 60) * Cells(PartNumRow, 51).Value
     
    'Task5 Information
    'Labor Rate5
    Cells(PartNumRow, 60).Value = Application.WorksheetFunction.VLookup(Combo_Task5.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge5                                    Labor Rate5                                      Time5
    Cells(PartNumRow, 61).Value = (Cells(PartNumRow, 60).Value / 60) * Cells(PartNumRow, 59).Value
      
    'Task6 Information
    'Labor Rate6
    Cells(PartNumRow, 68).Value = Application.WorksheetFunction.VLookup(Combo_Task6.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge6                                    Labor Rate6                                      Time6
    Cells(PartNumRow, 69).Value = (Cells(PartNumRow, 68).Value / 60) * Cells(PartNumRow, 67).Value
     
    'Task7 Information
    'Labor Rate7
    Cells(PartNumRow, 76).Value = Application.WorksheetFunction.VLookup(Combo_Task7.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge7                                    Labor Rate7                                      Time7
    Cells(PartNumRow, 77).Value = (Cells(PartNumRow, 76).Value / 60) * Cells(PartNumRow, 75).Value
      
    'Task8 Information
    'Labor Rate8
    Cells(PartNumRow, 84).Value = Application.WorksheetFunction.VLookup(Combo_Task8.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge8                                    Labor Rate8                                      Time8
    Cells(PartNumRow, 85).Value = (Cells(PartNumRow, 84).Value / 60) * Cells(PartNumRow, 83).Value
      
    'Task9 Information
    'Labor Rate9
    Cells(PartNumRow, 92).Value = Application.WorksheetFunction.VLookup(Combo_Task9.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge9                                    Labor Rate9                                      Time9
    Cells(PartNumRow, 93).Value = (Cells(PartNumRow, 92).Value / 60) * Cells(PartNumRow, 91).Value
      
    'Task10 Information
    'Labor Rate10
    Cells(PartNumRow, 100).Value = Application.WorksheetFunction.VLookup(Combo_Task10.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge10                                    Labor Rate10                                      Time10
    Cells(PartNumRow, 101).Value = (Cells(PartNumRow, 100).Value / 60) * Cells(PartNumRow, 99).Value
    
'Task11 Information
    'Labor Rate11
    Cells(PartNumRow, 108).Value = Application.WorksheetFunction.VLookup(Combo_Task11.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge11                                    Labor Rate11                                      Time11
    Cells(PartNumRow, 109).Value = (Cells(PartNumRow, 108).Value / 60) * Cells(PartNumRow, 107).Value
    
'Task12 Information
    'Labor Rate12
    Cells(PartNumRow, 116).Value = Application.WorksheetFunction.VLookup(Combo_Task12.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge12                                    Labor Rate12                                      Time12
    Cells(PartNumRow, 117).Value = (Cells(PartNumRow, 116).Value / 60) * Cells(PartNumRow, 115).Value
    
'Task13 Information
    'Labor Rate13
    Cells(PartNumRow, 124).Value = Application.WorksheetFunction.VLookup(Combo_Task13.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge13                                    Labor Rate13                                      Time13
    Cells(PartNumRow, 125).Value = (Cells(PartNumRow, 124).Value / 60) * Cells(PartNumRow, 123).Value
   
'Task14 Information
    'Labor Rate14
    Cells(PartNumRow, 132).Value = Application.WorksheetFunction.VLookup(Combo_Task14.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge14                                    Labor Rate14                                      Time14
    Cells(PartNumRow, 133).Value = (Cells(PartNumRow, 132).Value / 60) * Cells(PartNumRow, 131).Value
    
'Task15 Information
    'Labor Rate15
    Cells(PartNumRow, 140).Value = Application.WorksheetFunction.VLookup(Combo_Task15.Value, Range("Processes!$A$6:$N$48"), 11, False)
    'Charge15                                    Labor Rate15                                      Time15
    Cells(PartNumRow, 141).Value = (Cells(PartNumRow, 140).Value / 60) * Cells(PartNumRow, 139).Value
    
    
    'Polaris Data
    'Raw Material
    Cells(PartNumRow, 8).Value = Cells(PartNumRow, 7).Value
    
    'Direct Labor
'Cells to add for Charge                           Task1                                 Task 2                              Task3                                   Task4                                   Task5                                   Task6                               Task7                                   Task8                               Task9                                       Task10                              Task11                                     Task12                              Task13                                      Task14                                  Task15
    Cells(PartNumRow, 10).Value = Cells(PartNumRow, 29).Value + Cells(PartNumRow, 37).Value + Cells(PartNumRow, 45).Value + Cells(PartNumRow, 53).Value + Cells(PartNumRow, 61).Value + Cells(PartNumRow, 69).Value + Cells(PartNumRow, 77).Value + Cells(PartNumRow, 85).Value + Cells(PartNumRow, 93).Value + Cells(PartNumRow, 101).Value + Cells(PartNumRow, 109).Value + Cells(PartNumRow, 117).Value + Cells(PartNumRow, 125).Value + Cells(PartNumRow, 133).Value + Cells(PartNumRow, 141).Value
    'Setup Fee Total                                   Setup Fee 1                    Setup Fee 2                              Setup Fee3                            Setup Fee4                           Setup Fee5                           Setup Fee6                            Setup Fee7                                Setup Fee8                          Setup Fee9                           Setup Fee10                Setup Fee11                          Setup Fee12                        Setup Fee13                             Setup Fee14                            Setup Fee15
    Cells(PartNumRow, 11).Value = Cells(PartNumRow, 30).Value + Cells(PartNumRow, 38).Value + Cells(PartNumRow, 46).Value + Cells(PartNumRow, 54).Value + Cells(PartNumRow, 62).Value + Cells(PartNumRow, 70).Value + Cells(PartNumRow, 78).Value + Cells(PartNumRow, 86).Value + Cells(PartNumRow, 94).Value + Cells(PartNumRow, 102).Value + Cells(PartNumRow, 110).Value + Cells(PartNumRow, 118).Value + Cells(PartNumRow, 126).Value + Cells(PartNumRow, 134).Value + Cells(PartNumRow, 142).Value
    'Tooling Total                                            Tooling1                              Tooling2                            Tooling3                                 Tooling4                               Tooling5                                 Tooling6                            Tooling7                                 Tooling8                              Tooling9                                       Tooling10                Tooling11                               Tooling12                                 Tooling13                               Tooling14                                   Tooling15
    Cells(PartNumRow, 12).Value = Cells(PartNumRow, 32).Value + Cells(PartNumRow, 40).Value + Cells(PartNumRow, 48).Value + Cells(PartNumRow, 56).Value + Cells(PartNumRow, 64).Value + Cells(PartNumRow, 72).Value + Cells(PartNumRow, 80).Value + Cells(PartNumRow, 88).Value + Cells(PartNumRow, 96).Value + Cells(PartNumRow, 104).Value + Cells(PartNumRow, 112).Value + Cells(PartNumRow, 120).Value + Cells(PartNumRow, 128).Value + Cells(PartNumRow, 136).Value + Cells(PartNumRow, 144).Value
   'Setup Applied Fee Total                    Applied1                                     Applied2                                  Applied3                                   Applied4                                Applied5                                             Applied6                                  Applied7                                    Applied8                                 Applied9                                Applied10                                   Applied11                                       Applied12                                  Applied13                                   Applied14                               Applied15
    Cells(PartNumRow, 13).Value = Cells(PartNumRow, 31).Value + Cells(PartNumRow, 39).Value + Cells(PartNumRow, 47).Value + Cells(PartNumRow, 55).Value + Cells(PartNumRow, 64).Value + Cells(PartNumRow, 71).Value + Cells(PartNumRow, 79).Value + Cells(PartNumRow, 87).Value + Cells(PartNumRow, 95).Value + Cells(PartNumRow, 103).Value + Cells(PartNumRow, 111).Value + Cells(PartNumRow, 119).Value + Cells(PartNumRow, 127).Value + Cells(PartNumRow, 135).Value + Cells(PartNumRow, 143).Value
  
    'Polaris Price per Part Verification
    Cells(PartNumRow, 14).Value = Cells(PartNumRow, 8).Value + Cells(PartNumRow, 9).Value + Cells(PartNumRow, 10).Value
    '+ Cells(PartNumRow, 11).Value + Cells(PartNumRow, 12).Value + Cells(PartNumRow, 13).Value
'Cost per Part Total                       Material Cost                   Task Cost1                              Task Cost2                              Task Cost3                          Task Cost4                          Task Cost5                          Task Cost6                              Task Cost7                      Task Cost8                              Task Cost9                      Task Cost10                         Task Cost11                           Task Cost12                          Task Cost13                           Task Cost14                           Task Cost15
Cells(PartNumRow, 2).Value = Cells(PartNumRow, 7).Value + Cells(PartNumRow, 29).Value + Cells(PartNumRow, 37).Value + Cells(PartNumRow, 45).Value + Cells(PartNumRow, 53).Value + Cells(PartNumRow, 61).Value + Cells(PartNumRow, 69).Value + Cells(PartNumRow, 77).Value + Cells(PartNumRow, 85).Value + Cells(PartNumRow, 93).Value + Cells(PartNumRow, 101).Value + Cells(PartNumRow, 109).Value + Cells(PartNumRow, 117).Value + Cells(PartNumRow, 125).Value + Cells(PartNumRow, 133).Value + Cells(PartNumRow, 141).Value

'Purchased Component Costs
If CheckBox1.Value = True Then
   Cells(PartNumRow, 9).Value = Cells(PartNumRow, 2).Value
Else
   Cells(PartNumRow, 9).Value = 0
End If

If Cells(PartNumRow, 9).Value > 0 Then
    Cells(PartNumRow, 8).Value = 0
   
Else
   Cells(PartNumRow, 8).Value = Cells(PartNumRow, 7).Value
End If
Dim r
Dim v
Dim s
Dim t
Dim w
Dim setapplyfeeA
Dim setapplyfeeB
Dim setapplyfeeC
Dim ToolfeeA
Dim ToolfeeB
Dim ToolfeeC
r = "Sub-Component Part Number -  " & Cells(PartNumRow, 1).Value & vbNewLine & "Sub-Component Description - " & Cells(PartNumRow, 6).Value & vbNewLine & "Part Cost - " & Cells(PartNumRow, 2).Value & vbNewLine & "Raw Material Cost - " & Cells(PartNumRow, 8).Value & vbNewLine & "Purchased Component Cost - " & Cells(PartNumRow, 9).Value & vbNewLine & "Net Labor/Machine Cost - " & Cells(PartNumRow, 10).Value & vbNewLine & "Material Name - " & Cells(PartNumRow, 17).Value & vbNewLine & "Quantity - " & Cells(PartNumRow, 18).Value & vbNewLine & "Units - " & Cells(PartNumRow, 19).Value & vbNewLine & "Cost per Unit - " & Cells(PartNumRow, 21).Value & vbNewLine & "Cost per Part - " & Cells(PartNumRow, 22).Value
v = "Material 2 Name - " & Cells(PartNumRow, 15).Value & vbNewLine & "Quantity 2 - " & Cells(PartNumRow, 16).Value & vbNewLine & "Units 2- " & Cells(PartNumRow, 20).Value & vbNewLine & "Cost per Unit 2- " & Cells(PartNumRow, 23).Value & vbNewLine & "Cost per Part 2 - " & Cells(PartNumRow, 24).Value
s = "Task 1 -  " & Cells(PartNumRow, 26).Value & vbNewLine & "Time 1 - " & Cells(PartNumRow, 27).Value & vbNewLine & "Task 2 - " & Cells(PartNumRow, 34).Value & vbNewLine & "Time 2 - " & Cells(PartNumRow, 35).Value & vbNewLine & "Task 3 - " & Cells(PartNumRow, 42).Value & vbNewLine & "Time 3 - " & Cells(PartNumRow, 43).Value & vbNewLine & "Task 4 - " & Cells(PartNumRow, 51).Value & vbNewLine & "Time 4 - " & Cells(PartNumRow, 52).Value & vbNewLine & "Task 5 - " & Cells(PartNumRow, 58).Value & vbNewLine & "Time 5 - " & Cells(PartNumRow, 59).Value
t = "Task 6 -  " & Cells(PartNumRow, 66).Value & vbNewLine & "Time 6 - " & Cells(PartNumRow, 67).Value & vbNewLine & "Task 7 - " & Cells(PartNumRow, 74).Value & vbNewLine & "Time 7 - " & Cells(PartNumRow, 75).Value & vbNewLine & "Task 8 - " & Cells(PartNumRow, 82).Value & vbNewLine & "Time 8 - " & Cells(PartNumRow, 83).Value & vbNewLine & "Task 9 - " & Cells(PartNumRow, 90).Value & vbNewLine & "Time 9 - " & Cells(PartNumRow, 91).Value & vbNewLine & "Task 10 - " & Cells(PartNumRow, 98).Value & vbNewLine & "Time 10 - " & Cells(PartNumRow, 99).Value
w = "Task 11 -  " & Cells(PartNumRow, 106).Value & vbNewLine & "Time 11 - " & Cells(PartNumRow, 107).Value & vbNewLine & "Task 12 - " & Cells(PartNumRow, 114).Value & vbNewLine & "Time 12 - " & Cells(PartNumRow, 115).Value & vbNewLine & "Task 13 - " & Cells(PartNumRow, 122).Value & vbNewLine & "Time 13 - " & Cells(PartNumRow, 123).Value & vbNewLine & "Task 14 - " & Cells(PartNumRow, 130).Value & vbNewLine & "Time 14 - " & Cells(PartNumRow, 131).Value & vbNewLine & "Task 15 - " & Cells(PartNumRow, 138).Value & vbNewLine & "Time 15 - " & Cells(PartNumRow, 139).Value
setapplyfeeA = "Setup Fee 1 -  " & Cells(PartNumRow, 30).Value & vbNewLine & "Setup Fee 2 - " & Cells(PartNumRow, 38).Value & vbNewLine & "Setup Fee 3 - " & Cells(PartNumRow, 46).Value & vbNewLine & "Setup Fee 4 - " & Cells(PartNumRow, 54).Value & vbNewLine & "Setup Fee 5 - " & Cells(PartNumRow, 62).Value
setapplyfeeB = "Setup Fee 6 -  " & Cells(PartNumRow, 70).Value & vbNewLine & "Setup Fee 7 - " & Cells(PartNumRow, 78).Value & vbNewLine & "Setup Fee 8 - " & Cells(PartNumRow, 86).Value & vbNewLine & "Setup Fee 9 - " & Cells(PartNumRow, 94).Value & vbNewLine & "Setup Fee 10 - " & Cells(PartNumRow, 102).Value
setapplyfeeC = "Setup Fee 11 -  " & Cells(PartNumRow, 110).Value & vbNewLine & "Setup Fee 12 - " & Cells(PartNumRow, 118).Value & vbNewLine & "Setup Fee 13 - " & Cells(PartNumRow, 126).Value & vbNewLine & "Setup Fee 14 - " & Cells(PartNumRow, 134).Value & vbNewLine & "Setup Fee 15 - " & Cells(PartNumRow, 142).Value
ToolfeeA = "Tooling 1 - " & Cells(PartNumRow, 32).Value & vbNewLine & "Tooling 2 - " & Cells(PartNumRow, 40).Value & vbNewLine & "Tooling 3 - " & Cells(PartNumRow, 48).Value & vbNewLine & "Tooling 4 - " & Cells(PartNumRow, 56).Value & vbNewLine & "Tooling 5 - " & Cells(PartNumRow, 64).Value
ToolfeeB = "Tooling 6 - " & Cells(PartNumRow, 72).Value & vbNewLine & "Tooling 7 - " & Cells(PartNumRow, 80).Value & vbNewLine & "Tooling 8 - " & Cells(PartNumRow, 88).Value & vbNewLine & "Tooling 9 - " & Cells(PartNumRow, 96).Value & vbNewLine & "Tooling 10 - " & Cells(PartNumRow, 104).Value
ToolfeeC = "Tooling 11 - " & Cells(PartNumRow, 112).Value & vbNewLine & "Tooling 12 - " & Cells(PartNumRow, 120).Value & vbNewLine & "Tooling 13 - " & Cells(PartNumRow, 128).Value & vbNewLine & "Tooling 14 - " & Cells(PartNumRow, 136).Value & vbNewLine & "Tooling 15 - " & Cells(PartNumRow, 144).Value
'MsgBox ("New Sub-Component Created with Operations:" & vbNewLine & vbNewLine & r & vbNewLine & v)
'MsgBox ("New Sub-Component Created with Operations:" & vbNewLine & vbNewLine & s & vbNewLine & t & vbNewLine & w)
'MsgBox ("New Sub-Component Created with Setup and Applied Setup Fees:" & vbNewLine & vbNewLine & setapplyfeeA & vbNewLine & setapplyfeeB & vbNewLine & setapplyfeeC)
'MsgBox ("New Sub-Component Created with Tooling Fees:" & vbNewLine & vbNewLine & ToolfeeA & vbNewLine & ToolfeeB & vbNewLine & ToolfeeC)
'MsgBox ("Click Finished to exit.")

Unload Me
End Sub
 
Last edited by a moderator:
Upvote 0
Obviously I am doing something wrong, after I answer a question I get no more replies. Can some one tell me what I need to do differently? Also can some one tell me what the envelope on my post being highlighted red means? Thanks for any help.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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