consolidator
152 строки · 5.8 Кб
1Attribute VB_Name = "M3_Îáùèé"
2Sub Ï0140_Ðåçüáà_òèïîâàÿ()
3On Error Resume Next
4For s0 = 1 To 200
5If Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(1, s0) = "Ðåçüáà" Then Exit For
6Next
7For i = 4 To 300
8q0 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0) 'Òèï_ðåçüáû
9q1 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 1) 'Ðåçüáà_òèï
10If UCase(q0) = UCase(Òèï_ðåçüáû) Then
11Ðåçüáà_òèï = q1: Exit For
12End If
13Next
14End Sub
15
16Sub Ï0130_Ìàðêà_ñòàëè_ïî_Ãð_ñâîéñòâ() '"Ãðóïïû ìàðîê ñòàëè ïî ïîòðåáèòåëüñêèì ñâîéñòâàì"
17On Error Resume Next
18If Ìàðêà_ñòàëè = "" Or Ìàðêà_ñòàëè = "-" Then Ãð_ñâîéñòâ = "ÃÓ"
19If i_ñòðîê_ÍÏ = 7 Then
20q = q
21End If
22For s0 = 1 To 200
23If Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(1, s0) _
24= "Ãðóïïû ìàðîê ñòàëè ïî ïîòðåáèòåëüñêèì ñâîéñòâàì" Then Exit For
25Next
26For i = 4 To 300
27q0 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0)
28q1 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 1)
29If UCase(Ìàðêà_ñòàëè) = UCase(q0) And q0 <> "" Then Ãð_ñâîéñòâ = q1
30Next
31If Ïðîäóêò = "ÒÐÓÁÀ Ä" And Ãð_ñâîéñòâ = "ÃÞ" Then Ãð_ñâîéñòâ = "ÃÓ"
32
33End Sub
34
35Sub Ï0120_Ìàïïèíã_Êë_ïðî÷íîñòè() '"Ìàïïèíã êëàññà ïðî÷íîñòè"
36On Error Resume Next
37For s0 = 1 To 200
38If Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(1, s0) _
39= "Ìàïïèíã êëàññà ïðî÷íîñòè" Then Exit For
40Next
41For i = 4 To 300
42q0 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0)
43q1 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 1)
44If InStr(1, UCase(Ìàðêà_ñòàëè), UCase(q0)) > 0 And q0 <> "" Then Ìàðêà_ñòàëè = q1
45If InStr(1, UCase(Êë_ïðî÷íîñòè), UCase(q0)) > 0 And q0 <> "" Then Êë_ïðî÷íîñòè = q1
46Next
47End Sub
48
49Sub Ï0121_Ïðèâåäåíèå_Êë_ïðî÷íîñòè()
50On Error Resume Next
51If i_ñòðîê_ÍÏ = 176 Then
52q = q
53End If
54q = 0
55If Êë_ïðî÷íîñòè <> 0 And Len(Êë_ïðî÷íîñòè) = 3 Then
56If IsNumeric(CSng(Mid(Êë_ïðî÷íîñòè, 2, 2))) = True Then
57If CSng(Mid(Êë_ïðî÷íîñòè, 2, 2)) < 100 Then q = 65
58If CSng(Mid(Êë_ïðî÷íîñòè, 2, 2)) < 65 Then q = 60
59If CSng(Mid(Êë_ïðî÷íîñòè, 2, 2)) < 60 Then q = 55
60If CSng(Mid(Êë_ïðî÷íîñòè, 2, 2)) < 55 Then q = 52
61Êë_ïðî÷íîñòè_ïðèâ = "Ê" & q
62End If
63End If
64End Sub
65Sub Ï0112_Ãðóïïà_ïî_êëàññó_ïðî÷íîñòè_äëÿ_ìóôò() '"Êëàññ ïðî÷íîñòè ïî ìàðêå ñòàëè"
66On Error Resume Next
67For s0 = 1 To 200
68If Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(1, s0) = "Ãðóïïà ïî êëàññó ïðî÷íîñòè äëÿ ìóôò" Then Exit For
69Next
70Ãð_ïðî÷í = "ÏD"
71For i = 4 To 300
72q0 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0)
73q1 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 1)
74If UCase(Êë_ïðî÷íîñòè) = UCase(q0) Then Ãð_ïðî÷í = q1
75
76Next
77End Sub
78
79
80Sub Ï0111_Ãðóïïà_ïî_êëàññó_ïðî÷íîñòè_äëÿ_òðóá() '"Êëàññ ïðî÷íîñòè ïî ìàðêå ñòàëè"
81On Error Resume Next
82For s0 = 1 To 200
83If Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(1, s0) = "Ãðóïïà ïî êëàññó ïðî÷íîñòè äëÿ òðóá" Then Exit For
84Next
85Ãð_ïðî÷í = "ÏD"
86For i = 4 To 300
87q0 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0)
88q1 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 1)
89If UCase(Êë_ïðî÷íîñòè) = UCase(q0) Then Ãð_ïðî÷í = q1
90If UCase(Ìàðêà_ñòàëè) = UCase(q0) Then Ãð_ïðî÷í = q1
91Next
92End Sub
93
94Sub Ï0110_Êë_ïðî÷íîñòè_ïî_ìàðêå_ñòàëè() '"Êëàññ ïðî÷íîñòè ïî ìàðêå ñòàëè"
95On Error Resume Next
96For s0 = 1 To 200
97If Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(1, s0) = "Êëàññ ïðî÷íîñòè ïî ìàðêå ñòàëè" Then Exit For
98Next
99If i_ñòðîê_ÍÏ = 34 Then
100q = q
101End If
102For i = 4 To 300
103q0 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0)
104q1 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 1)
105If UCase(Ìàðêà_ñòàëè) = UCase(q0) Then Êë_ïðî÷íîñòè = q1
106Next
107End Sub
108
109Sub Ï0101_Îïðåäåëåíèå_Ïðèçíàêà_ïðîêàò()
110On Error Resume Next
111For s0 = 1 To 200
112If Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(1, s0) = "Ïðîäóêò ïî ÍÒÄ" Then Exit For
113Next
114For i = 4 To 500
115q0 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0) 'Ïðîèçâîäñòâî
116q1 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 1) 'ÍÒÄ
117q2 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 2) 'Ïðîäóêò
118q3 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 3) 'Äîï ïðèçíàê
119
120If UCase(ÍÒÄ_êà÷_ïðîêàò) = UCase(q1) Then
121Ïðèçíàê = q3
122Exit For
123End If
124Next
125End Sub
126
127Sub Ï0100_Ïðîäóêò()
128On Error Resume Next
129q0 = "ïðîêàò ðóëîííûé î" ' ðóñê
130q1 = "ïðîêàò ðóëîííûé o" ' eng
131If InStr(1, LCase(Ïîëíîå_íèìåíîâàíèå), q0) > 0 Or InStr(1, LCase(Ïîëíîå_íèìåíîâàíèå), q1) > 0 Then
132Ïðîäóêò = "ÏÎËÎÑÀ"
133Exit Sub
134ElseIf InStr(1, LCase(Ïîëíîå_íèìåíîâàíèå), "ïðîêàò ðóëîííûé") > 0 Then
135Ïðîäóêò = "ÐÓËÎÍ"
136Exit Sub
137End If
138For s0 = 1 To 200
139If Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(1, s0) = "Ïðîäóêò ïî ÍÒÄ" Then Exit For
140Next
141For i = 4 To 500
142q0 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0) 'Ïðîèçâîäñòâî
143q1 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 1) 'ÍÒÄ
144q2 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 2) 'Ïðîäóêò
145q3 = Workbooks(ÈìÿÔàéëà_Ðàá).Sheets("Ñïðàâî÷íèê").Cells(i, s0 + 3) 'Äîï ïðèçíàê
146If UCase(Ïðîèçâîäñòâî) = UCase(q0) _
147And UCase(ÍÒÄ_êà÷_ïðîêàò) = UCase(q1) Or UCase(ÍÒÄ_êà÷_òðóá) = UCase(q1) Then
148Ïðîäóêò = q2
149Exit For
150End If
151Next
152End Sub
153
154