Code VBA-technisch verbessern
Lorenz
Läßt sich diese Code (Makro) Programmiertechnisch (vielleicht auch in Sachen "performance") verbessern, kürzen, oder auch erneuern?
hier der Code:
Dim iR As Integer, iC As Integer, iRz As Integer, iCz As Integer, iSt As Integer
Dim iBeg As Integer, iEnd As Integer
iBeg = 15
iEnd = 71
iRz = 5
iCz = 2
iC = 4
iSt = ActiveCell.Column + 1
For iR = iBeg To iEnd
If Cells(iR, iSt - 1) = "K" Or Cells(iR, iSt - 1) = "U" Or Cells(iR, iSt - 1) = "F" Then GoTo WeiterMo
If Cells(iR, iSt) <> "" And Cells(iR, iSt).Interior.ColorIndex <> xlNone _
Or Cells(iR, iSt - 1) <> "" And Cells(iR, iSt - 1).Interior.ColorIndex <> xlNone Or Cells(iR, iSt - 1).Interior.ColorIndex = 15 Then
With shAushang
.Cells(iRz, iCz) = Cells(iR, iC)
.Cells(iRz, iCz - 1) = Cells(iR, iSt - 1)
End With
iRz = iRz + 1
WeiterMo: If Cells(iR, iSt) > "" And Cells(iR, iSt).Interior.ColorIndex <> xlNone Or Cells(iR, iSt).Interior.ColorIndex = 6 Or Cells(iR, iSt).Interior.ColorIndex = 15 Then
shAushang.Cells(iRz - 1, iCz + 1) = Cells(iR, iSt)
If Cells(iR, iSt) = "o" And Cells(iR, iSt).Interior.ColorIndex <> xlNone Or Cells(iR, iSt).Interior.ColorIndex = 6 Or Cells(iR, iSt).Interior.ColorIndex = 15 Then
shAushang.Cells(iRz - 1, iCz + 1) = "V6"
ElseIf Cells(iR, iSt) > "" And Cells(iR, iSt).Interior.ColorIndex <> xlNone Or Cells(iR, iSt).Interior.ColorIndex = 6 Or Cells(iR, iSt).Interior.ColorIndex = 15 Then
shAushang.Cells(iRz - 1, iCz + 1) = "V8"
Else: shAushang.Cells(iRz - 1, iCz + 1) = Cells(iR, iSt)
End If
End If
End If
Next
.......
Hat vielleicht jemand ne Idee dazu?
Gruß
Lorenz