Why it gives an error subscript out of range?

Why error Why it gives an error subscript out of range?
all the line where the ActiveWorkbook.Worksheets(List).Cells(k, 2)
(do not put under <code>code> because all Russian change the characters)

spoiler
Option Base 1
Ном1 Dim As Integer Group1 As Integer, Cell As Integer
Инф1 Dim As Integer, As Integer Мат1, ПСП1 As Integer
Dim ПТАКТ1 As Integer, a As Integer Cold
Dim Srval(1 To 4) As Currency
Public Фам1 As String
Public List As String
Public k As Integer

Private Sub Дан_Экзамен_Initialize()
k = 4
Workbooks.Add
Ном1 = ActiveWorkbook.Worksheets(List).Cells(k, 1)
Group1 = ActiveWorkbook.Worksheets(List).Cells(k, 2)
Фам1 = ActiveWorkbook.Worksheets(List).Cells(k, 3)
Инф1 = ActiveWorkbook.Worksheets(List).Cells(k, 4)
Мат1 = ActiveWorkbook.Worksheets(List).Cells(k, 5)
ПСП1 = ActiveWorkbook.Worksheets(List).Cells(k, 6)
ПТАКТ1 = ActiveWorkbook.Worksheets(List).Cells(k, 7)
Cold = ActiveWorkbook.Worksheets(List).Cells(k, 8)

Room.Value = Ном1
Wodim.Value = Фам1
Wtop.Value = Group1
Vibrocone.Value = Инф1
Выбор_Оценка1.Value = Мат1
Выбор_Оценка2.Value = ПСП1
Выбор_Оценка3.Value = ПТАКТ1
Wodd.Value = Cold
For j = 1 To 4
Srbl(j) = ActiveWorkbook.Worksheets(List).Cells(14, j + 3)
Next j
Вывод_ср1.Value = Srval(1)
Вывод_ср2.Value = Srbal(2)
Вывод_ср3.Value = Srval(3)
Вывод_ср4.Value = Srval(4)

Vibrocone.RowSource = "k5:k8"
Выбор_Оценка1.RowSource = "k5:k8"
Выбор_Оценка2.RowSource = "k5:k8"
Выбор_Оценка3.RowSource = "k5:k8"
End Sub

Private Sub Vibrocentric()
Инф1 = Vibrocone.Value
End Sub

Private Sub Выбор_Оценка1_Сһапде()
Мат1 = Выбор_Оценка1.Value
End Sub

Private Sub Выбор_Оценка2_Сһапде()
ПСП1 = Выбор_Оценка2.Value
End Sub

Private Sub Выбор_Оценка3_Сһапде()
ПТАКТ1 = Выбор_Оценка3.Value
End Sub

Private Sub Кн_Ввод_Click()
ActiveWorkbook.Worksheets(List).Cells(k, 4) = Инф1
ActiveWorkbook.Worksheets(List).Cells(k, 5) = Мат1
ActiveWorkbook.Worksheets(List).Cells(k, 6) = ПСП1
ActiveWorkbook.Worksheets(List).Cells(k, 7) = ПТАКТ1

Cold = 0

For i = 4 To 7
If ActiveWorkbook.Worksheets(List).Cells(k, i) = 2 Then Cold = Cold + 1
Next i

ActiveWorkbook.Worksheets(List).Cells(k, 8) = Cold
Wodd.Value = Cold

For j = 1 To 4
Srbl(j) = 0
For M = 4 To 13
Srbl(j) = Srbl(j) + ActiveWorkbook.Worksheets(List).Cells(M, j + 3)
Next M
Srbl(j) = Srbl(j) / 10
ActiveWorkbook.Worksheets(List).Cells(14, j + 3) = Srbl(j)
Next j
Вывод_ср1.Value = Srval(1)
Вывод_ср2.Value = Srbal(2)
Вывод_ср3.Value = Srval(3)
Вывод_ср4.Value = Srval(4)
End Sub

Private Sub Кн_Выход_Click()
Dim M As String, T As String, R As String
Dim St As String
M = "do you Want to finish the job?"
St = vbYesNo + vbCritical + vbDefaultButton2
T = "exit the program!"
R = MsgBox(M, St, T)
If R = vbYes Then
Unload Me
End If
End Sub

Private Sub Кн_Редактировать_Click()
Room.Enabled = True
Wodim.Enabled = True
Vibrocone.Enabled = True
Выбор_Оценка3.Enabled = True
Выбор_Оценка1.Enabled = True
Выбор_Оценка2.Enabled = True
Wtop.Enabled = True
End Sub

Private Sub Счет_SpinDown()
Room.Enabled = False
Wodim.Enabled = False
Vibrocone.Enabled = False
Выбор_Оценка3.Enabled = False
Выбор_Оценка1.Enabled = False
Выбор_Оценка2.Enabled = False
Wtop.Enabled = False

If k > 4 Then k = k + 1
Ном1 = ActiveWorkbook.Worksheets(List).Cells(k, 1)
Group1 = ActiveWorkbook.Worksheets(List).Cells(k, 2)
Фам1 = ActiveWorkbook.Worksheets(List).Cells(k, 3)
Инф1 = ActiveWorkbook.Worksheets(List).Cells(k, 4)
Мат1 = ActiveWorkbook.Worksheets(List).Cells(k, 5)
ПСП1 = ActiveWorkbook.Worksheets(List).Cells(k, 6)
ПТАКТ1 = ActiveWorkbook.Worksheets(List).Cells(k, 7)
Cold = ActiveWorkbook.Worksheets(List).Cells(k, 8)
Room.Value = Ном1
Wodim.Value = Фам1
Wtop.Value = Group1
Vibrocone.Value = Инф1
Выбор_Оценка1.Value = Мат1
Выбор_Оценка2.Value = ПСП1
Выбор_Оценка3.Value = ПТАКТ1
Wodd.Value = Cold
End Sub

Private Sub Счет_SpinUp()
Room.Enabled = False
Wodim.Enabled = False
Vibrocone.Enabled = False
Выбор_Оценка3.Enabled = False
Выбор_Оценка1.Enabled = False
Выбор_Оценка2.Enabled = False
Wtop.Enabled = False

If k < 13 Then k = k + 1
Ном1 = ActiveWorkbook.Worksheets(List).Cells(k, 1)
Group1 = ActiveWorkbook.Worksheets(List).Cells(k, 2)
Фам1 = ActiveWorkbook.Worksheets(List).Cells(k, 3)
Инф1 = ActiveWorkbook.Worksheets(List).Cells(k, 4)
Мат1 = ActiveWorkbook.Worksheets(List).Cells(k, 5)
ПСП1 = ActiveWorkbook.Worksheets(List).Cells(k, 6)
ПТАКТ1 = ActiveWorkbook.Worksheets(List).Cells(k, 7)
Cold = ActiveWorkbook.Worksheets(List).Cells(k, 8)
Room.Value = Ном1
Wodim.Value = Фам1
Wtop.Value = Group1
Vibrocone.Value = Инф1
Выбор_Оценка1.Value = Мат1
Выбор_Оценка2.Value = ПСП1
Выбор_Оценка3.Value = ПТАКТ1
Wodd.Value = Cold
End Sub

Sub Auto_Open()
Danajamin.Show
End Sub
June 5th 19 at 21:23
1 answer
June 5th 19 at 21:25
You have not declared the creation of the sheet after the creation of the book.
Add the line here

Private Sub Дан_Экзамен_Initialize()
k = 4
Workbooks.Add

Worksheets.Add.Name = "List" -- here's this line here in this place

Ном1 = ActiveWorkbook.Worksheets(List).Cells(k, 1)

And when you refer to a direct sheet name (in your case List), then it needs to be recorded List and "List" is in quotes.

PS Then the macro will give an error on the line Number.Value = Ном1
But unfortunately not have much time for You to rewrite the entire macro as a whole.

But jobs question answer there :-)

Find more questions by tags ExcelVisual Basic