Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
On Worksheet_Change event I restore format of target cells and want to reduce the execute time as much as possible. I have several other restore subs than this, to restore validation, conditionformats, interior.colors, fonts etc. and I hope I could make a difference with usage of IF conditions everywere. If any of you know which way is fastest, I don't need to change a lot of code just to test this ...EXAMPLES: Sub BordThinBlackBottom(rngForm As Range) With rngForm.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .Color = RGB(0, 0, 0) End With Exit Sub End Sub End Sub ....OR ... Sub BordThinBlackBottom_If(rngForm As Range) With rngForm.Borders(xlEdgeBottom) if .LineStyle < xlContinuous then .LineStyle = xlContinuous end if if .Weight < xlThin then .Weight = xlThin end if if .Color < RGB(0, 0, 0) then .Color = RGB(0, 0, 0) end if End With End Sub Kind regards Tskogstrom |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... | Excel Programming |