Здравствуйте. Не работает макрос в офисе 365. Подскажите в чем может быть проблема?
Sub Tablica2dd()
Dim i As Long
Dim iLastRow As Long
Dim FoundNomer As Range
Dim j As Integer
iLastRow = Cells(Rows.Count, 4).End(xlUp).Row
MsgBox iLastRow
With Worksheets("Рейсы")
For i = 1 To iLastRow
Set FoundNomer = .Columns(1).Find(Cells(i, "F"), , xlValues, xlWhole)
If Not FoundNomer Is Nothing Then
For j = 16 To 26
If IsEmpty(.Cells(FoundNomer.Row, j + 1)) Or _
.Cells(FoundNomer.Row, j + 1) = Worksheets("Рейсы").Range("AX3") Then
.Cells(FoundNomer.Row, j + 1) = Cells(i, "D") 'date
.Cells(FoundNomer.Row, j + 11) = Cells(i, "I") 'summ
.Cells(FoundNomer.Row, j + 21) = Cells(i, "K") 'tran
Exit For
End If
Next
Else
MsgBox "На листе 'Лист2' нет номера: " & Cells(i, "F")
End If
Next
End With
End Sub
Sub Tablica2dd()
Dim i As Long
Dim iLastRow As Long
Dim FoundNomer As Range
Dim j As Integer
iLastRow = Cells(Rows.Count, 4).End(xlUp).Row
MsgBox iLastRow
With Worksheets("Рейсы")
For i = 1 To iLastRow
Set FoundNomer = .Columns(1).Find(Cells(i, "F"), , xlValues, xlWhole)
If Not FoundNomer Is Nothing Then
For j = 16 To 26
If IsEmpty(.Cells(FoundNomer.Row, j + 1)) Or _
.Cells(FoundNomer.Row, j + 1) = Worksheets("Рейсы").Range("AX3") Then
.Cells(FoundNomer.Row, j + 1) = Cells(i, "D") 'date
.Cells(FoundNomer.Row, j + 11) = Cells(i, "I") 'summ
.Cells(FoundNomer.Row, j + 21) = Cells(i, "K") 'tran
Exit For
End If
Next
Else
MsgBox "На листе 'Лист2' нет номера: " & Cells(i, "F")
End If
Next
End With
End Sub