K0st4din
Well-known Member
- Joined
- Feb 8, 2012
- Messages
- 501
- Office Version
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hello, everyone,
I made 3 macros by hand with clicks.
I would like to ask if someone can help and make each of the macros separately (individually, I'll make a button) to be able to run in 30 worksheets, eg London, Paris, Germany, etc. to the end.
Because now I do this thing by opening every single worksheet and it takes me an awful lot of time.
I have necessarily left in the macro which cells I marked, because after a while I will have to run the same macro, but in neighboring cells.
Thank you in advance!
Be healthy!
I made 3 macros by hand with clicks.
I would like to ask if someone can help and make each of the macros separately (individually, I'll make a button) to be able to run in 30 worksheets, eg London, Paris, Germany, etc. to the end.
Because now I do this thing by opening every single worksheet and it takes me an awful lot of time.
I have necessarily left in the macro which cells I marked, because after a while I will have to run the same macro, but in neighboring cells.
Thank you in advance!
Be healthy!
VBA Code:
Sub test2BLACK()
Application.ScreenUpdating = True
Range("O62:Z62").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=N62<O62"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = True
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.Pattern = xlNone
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Application.ScreenUpdating = False
End Sub
Code:
Sub TEST3RED()
Application.ScreenUpdating = True
Range("P62:Z62").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=O62>P62"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = True
.Color = -16776961
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.Pattern = xlNone
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Application.ScreenUpdating = False
End Sub
Code:
Sub table()
Application.ScreenUpdating = True
Range("O3:Z60").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=O3=MAX($O3:$Z3)"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = True
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.599963377788629
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(O3))=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.Pattern = xlNone
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Application.ScreenUpdating = False
End Sub