This code involves three sheets: "MAIN SHEET" "Custom Labels" & "Normal Labels"
This is what I would like for it to do:
On "Custom Labels" and "Normal Labels"
Unprotects both sheets - PW: "123"
On "Custom Labels" sheet:
Clears A2:A200, B2:B200, C2:C200, D2:D200, E2:E200, F2:F200
On "Normal Labels" sheet:
Clears A2:A200, B2:B200, C2:C200, D2:D200, E2:E200, F2:F200, G2:G200
On "MAIN SHEET":
Column A2:A100 - Has to have the text "C", or "N" otherwise moves to the next row.
For all the rows that have "C" in column A it performs this for only applicable rows:
Sub Serials()
Dim lr, i, j, k, m As Long
lr = Sheets("MAIN SHEET").Cells(Rows.Count, "B").End(xlUp).Row
j = 2
For i = 2 To lr
k = Sheets("MAIN SHEET").Cells(i, 19)
For m = k To k + Sheets("MAIN SHEET").Cells(i, 20) - Sheets("MAIN SHEET").Cells(i, 19)
Sheets("C").Cells(j, 1) = Sheets("MAIN SHEET").Cells(i, 2)
Sheets("C").Cells(j, 6) = Sheets("MAIN SHEET").Cells(i, 2)
Sheets("C").Cells(j, 2) = Sheets("MAIN SHEET").Cells(i, 10)
Sheets("C").Cells(j, 11) = m
j = j + 1
Next m
k = k + 1
Next i
End Sub
For all the rows that have "N" in column A it performs this for that row:
It looks for the quantity in column "U" on "main sheet", then copies over the following information onto sheet "Normal Labels" for the same row:
Column C ---> Column A2:A200
Column B ---> Column B2:B200
Column H ---> Column C2:C200
Column U ---> Column D2:D200
Column V ---> Column E2:E200
Column H ---> Column F2:F200
It will add this information only for the first instance for that row:
Column W ---> Column G2:G200
Column X ---> Column H2:H200
Then it protects both of those sheets again with a password.
This is what I would like for it to do:
On "Custom Labels" and "Normal Labels"
Unprotects both sheets - PW: "123"
On "Custom Labels" sheet:
Clears A2:A200, B2:B200, C2:C200, D2:D200, E2:E200, F2:F200
On "Normal Labels" sheet:
Clears A2:A200, B2:B200, C2:C200, D2:D200, E2:E200, F2:F200, G2:G200
On "MAIN SHEET":
Column A2:A100 - Has to have the text "C", or "N" otherwise moves to the next row.
For all the rows that have "C" in column A it performs this for only applicable rows:
Sub Serials()
Dim lr, i, j, k, m As Long
lr = Sheets("MAIN SHEET").Cells(Rows.Count, "B").End(xlUp).Row
j = 2
For i = 2 To lr
k = Sheets("MAIN SHEET").Cells(i, 19)
For m = k To k + Sheets("MAIN SHEET").Cells(i, 20) - Sheets("MAIN SHEET").Cells(i, 19)
Sheets("C").Cells(j, 1) = Sheets("MAIN SHEET").Cells(i, 2)
Sheets("C").Cells(j, 6) = Sheets("MAIN SHEET").Cells(i, 2)
Sheets("C").Cells(j, 2) = Sheets("MAIN SHEET").Cells(i, 10)
Sheets("C").Cells(j, 11) = m
j = j + 1
Next m
k = k + 1
Next i
End Sub
For all the rows that have "N" in column A it performs this for that row:
It looks for the quantity in column "U" on "main sheet", then copies over the following information onto sheet "Normal Labels" for the same row:
Column C ---> Column A2:A200
Column B ---> Column B2:B200
Column H ---> Column C2:C200
Column U ---> Column D2:D200
Column V ---> Column E2:E200
Column H ---> Column F2:F200
It will add this information only for the first instance for that row:
Column W ---> Column G2:G200
Column X ---> Column H2:H200
Then it protects both of those sheets again with a password.