I am very new to macros. I recorded this macro.
I want to be able click on a cell and then have the highlighting go two to the right and then two down, change the border type and color.
I think I changed the absolute to relative as that being the right thing to do, but
it keeps going back to the same cells.
Here is the mcro.
Sub MakeBlue()
'
' MakeBlue Macro
'
' Keyboard Shortcut: Ctrl+f
'
ActiveCell.Offset(-2, -2).Range("A1:B2").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDash
.ThemeColor = 4
.TintAndShade = 0.599963377788629
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDash
.ThemeColor = 4
.TintAndShade = 0.599963377788629
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDash
.ThemeColor = 4
.TintAndShade = 0.599963377788629
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDash
.ThemeColor = 4
.TintAndShade = 0.599963377788629
.Weight = xlMedium
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End Sub
I want to be able click on a cell and then have the highlighting go two to the right and then two down, change the border type and color.
I think I changed the absolute to relative as that being the right thing to do, but
it keeps going back to the same cells.
Here is the mcro.
Sub MakeBlue()
'
' MakeBlue Macro
'
' Keyboard Shortcut: Ctrl+f
'
ActiveCell.Offset(-2, -2).Range("A1:B2").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDash
.ThemeColor = 4
.TintAndShade = 0.599963377788629
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDash
.ThemeColor = 4
.TintAndShade = 0.599963377788629
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDash
.ThemeColor = 4
.TintAndShade = 0.599963377788629
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDash
.ThemeColor = 4
.TintAndShade = 0.599963377788629
.Weight = xlMedium
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End Sub