02.06.2018, 14:29
Hallo Forum,
bei nachfolgendem Makro, welches prima funktioniert, möchte ich, daß die Einfärbung der Spalte 61 und 62 nur in Spate 62 getätigt wird. Bitte um Hilfe.
Sub Equi_get_Gelb _Sp61()
Dim loLastRow As Long, iCnt1 As Long, iCnt2 As Long, boSecond As Boolean
loLastRow = Cells(Rows.Count, 61).End(xlUp).Row
For iCnt1 = 4 To loLastRow
If IsNumeric(Cells(iCnt1, 61)) Then
If Cells(iCnt1, 61) >= 1 And Cells(iCnt1, 61) <= 5000 Then
With Range(Cells(iCnt1, 61), Cells(iCnt1, 62))
If .Interior.Color <> 65535 Then
.Interior.Color = 65535
With .Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
Exit For
End If
End With
End If
End If
Next
If iCnt1 = loLastRow + 1 Then Exit Sub
For iCnt2 = loLastRow To iCnt1 Step -1
If IsNumeric(Cells(iCnt1, 61)) Then
If Cells(iCnt2, 61) >= 1 And Cells(iCnt2, 61) <= 5000 Then
With Range(Cells(iCnt2, 61), Cells(iCnt2, 62))
If .Interior.Color <> 65535 Then
.Interior.Color = 65535
With .Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
If boSecond Then Exit For
boSecond = True
End If
End With
End If
End If
Next
End Sub
Im Voraus schon mal vielen Dank.
Grüsse Empo
bei nachfolgendem Makro, welches prima funktioniert, möchte ich, daß die Einfärbung der Spalte 61 und 62 nur in Spate 62 getätigt wird. Bitte um Hilfe.
Sub Equi_get_Gelb _Sp61()
Dim loLastRow As Long, iCnt1 As Long, iCnt2 As Long, boSecond As Boolean
loLastRow = Cells(Rows.Count, 61).End(xlUp).Row
For iCnt1 = 4 To loLastRow
If IsNumeric(Cells(iCnt1, 61)) Then
If Cells(iCnt1, 61) >= 1 And Cells(iCnt1, 61) <= 5000 Then
With Range(Cells(iCnt1, 61), Cells(iCnt1, 62))
If .Interior.Color <> 65535 Then
.Interior.Color = 65535
With .Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
Exit For
End If
End With
End If
End If
Next
If iCnt1 = loLastRow + 1 Then Exit Sub
For iCnt2 = loLastRow To iCnt1 Step -1
If IsNumeric(Cells(iCnt1, 61)) Then
If Cells(iCnt2, 61) >= 1 And Cells(iCnt2, 61) <= 5000 Then
With Range(Cells(iCnt2, 61), Cells(iCnt2, 62))
If .Interior.Color <> 65535 Then
.Interior.Color = 65535
With .Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
If boSecond Then Exit For
boSecond = True
End If
End With
End If
End If
Next
End Sub
Im Voraus schon mal vielen Dank.
Grüsse Empo