1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
On Error GoTo except:
For idxline = 1 To 5
If idxline = lengant + 1 Then GoTo suite:
strLabel = "Finish" & idxline
Application.Goto Reference:=strLabel
firstCellRow = ActiveCell.Row
firstCellCol = ActiveCell.Column
strLabel = "Start" & idxline
Application.Goto Reference:=strLabel
lastCellRow = ActiveCell.Row
lastCellCol = ActiveCell.Column
X:
Range(Cells(firstCellRow, firstCellCol), Cells(lastCellRow, lastCellCol)).Select
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next idxline
except:
codestrLabel = Left(strLabel, 4)
idxstrLabel = Right(strLabel, 1)
If codestrLabel = "Fini" Then
Application.Goto Reference:="Start" & idxstrLabel
ElseIf codestrLabel = "Star" Then
Application.Goto Reference:="Finish" & idxstrLabel
End If
lastCellRow = ActiveCell.Row
lastCellCol = ActiveCell.Column
firstCellRow = lastCellRow
firstCellCol = lastCellCol
Err.Clear
Resume X: |
Partager