Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As you've all been so helpful in the last couple of days and I'm on a roll
this evening (I'm in the UK)... I've recorded a macro to format lines on sheets the way I want them, but it's producing big, ugly lumps of code. Is there any way of combining or simplifying the repeated format instructions? Eg. the following is taken from a set of formats that simply put borders around each specified cell in a line: With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With This is repeated for each side,the internal divider and the horizontals! surely there is a way of applying the same format conditions to multiple "targets" (or whatever they are really called) TIA (again!) Dave |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps this...
Selection.Borders.LineStyle = xlContinuous -- HTH... Jim Thomlinson "Risky Dave" wrote: As you've all been so helpful in the last couple of days and I'm on a roll this evening (I'm in the UK)... I've recorded a macro to format lines on sheets the way I want them, but it's producing big, ugly lumps of code. Is there any way of combining or simplifying the repeated format instructions? Eg. the following is taken from a set of formats that simply put borders around each specified cell in a line: With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With This is repeated for each side,the internal divider and the horizontals! surely there is a way of applying the same format conditions to multiple "targets" (or whatever they are really called) TIA (again!) Dave |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
Again my thanks. I've just been able to delet about 100 lines of unused code as a result of that! Dave "Jim Thomlinson" wrote: Perhaps this... Selection.Borders.LineStyle = xlContinuous -- HTH... Jim Thomlinson "Risky Dave" wrote: As you've all been so helpful in the last couple of days and I'm on a roll this evening (I'm in the UK)... I've recorded a macro to format lines on sheets the way I want them, but it's producing big, ugly lumps of code. Is there any way of combining or simplifying the repeated format instructions? Eg. the following is taken from a set of formats that simply put borders around each specified cell in a line: With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With This is repeated for each side,the internal divider and the horizontals! surely there is a way of applying the same format conditions to multiple "targets" (or whatever they are really called) TIA (again!) Dave |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That line weirds out if you have diagonals in your cells but otherwise it is
a time saver... -- HTH... Jim Thomlinson "Risky Dave" wrote: Jim, Again my thanks. I've just been able to delet about 100 lines of unused code as a result of that! Dave "Jim Thomlinson" wrote: Perhaps this... Selection.Borders.LineStyle = xlContinuous -- HTH... Jim Thomlinson "Risky Dave" wrote: As you've all been so helpful in the last couple of days and I'm on a roll this evening (I'm in the UK)... I've recorded a macro to format lines on sheets the way I want them, but it's producing big, ugly lumps of code. Is there any way of combining or simplifying the repeated format instructions? Eg. the following is taken from a set of formats that simply put borders around each specified cell in a line: With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With This is repeated for each side,the internal divider and the horizontals! surely there is a way of applying the same format conditions to multiple "targets" (or whatever they are really called) TIA (again!) Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
condionally formatting based on another cells formatting? | Excel Discussion (Misc queries) | |||
conditionally formatting cells based on other cells | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
How can I have formatting options like merge cells ,Bold,active for the unlocked cells of the protected worksheet.Is it possible in excel? | Excel Programming | |||
Conditional Formatting Multiple cells based on 2 cells | Excel Worksheet Functions |