Ich habe Probleme beim Aufruf von Sub. Fehlermeldung ist falsche Anzahl von Argumenten oder ungültige Zuweisung von Eigenschaften. Ich habe viele Variationen ausprobiert und nichts hat funktioniert.Fehler beim Aufruf Sub in VBA
Sub last_non_empty_cell_in_a_row()
Dim rngCell As Range, i As Long
Set rngCell = Cells.Find(What:="*", After:=Cells(1, 1), LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:= _
False, SearchFormat:=False) '.Activate
i = rngCell.Row
End Sub
Sub code_main()
Dim x As Long
Call last_non_empty_cell_in_a_row(i)
For x = 1 To i
If Range("R" & x) = "m_M" Then
If Range("P" & x) = "m_DH" Then
If Range("Q" & x) = "" Then
Else
Range("P" & x, "R" & x).Interior.ColorIndex = 22
End If
Else
Range("P" & x, "R" & x).Interior.ColorIndex = 22
End If
Else
Range("P" & x, "R" & x).Interior.ColorIndex = 0
End If
Next x
End Sub
Sie passieren 'I' in 'last_non_empty_cell_in_a_row'. Das Sub nimmt keinen Parameter. –