ich habe mir mittels Makrorekorder folgendes Makro gebastelt.
Sub Rahmen_einfügen()
'Wenn Zelle gefüllt, dann Rahmen über bedingte Formatierung einfügen
Range("A1:Z30000").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=A1 """""
With Selection.FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
Wunsch wäre jedoch, dass abhängig von der Zelle in Spalte A der Rahmen gebildet wird, und das bis zur Spalte K.
Mein Problem ist nämlich, dass einzelne Zellen leer sind und diese nun keinen Rahmen haben.
Hat jemand einen Tipp für mich? Danke!
Tobias