Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
getting rid of selection for formatting
I have been given code that seems repetative, was trying to figure out a way
to shorten it up and make more efficient. is there a way to refer to the borders with one command. I was thinking of doing with within with statements as follows [***My Thoughts***] With Range(A1:AQ1") With .borders(xlEdgeLeft,wlEdgeTop, ..etc) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With .Font .Name = "Arial" .Size = 8 .Bold = False .ColorIndex = xlAutomatic End With End With [***The Code I need to modify***] Range("A1:AQ1").Select 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 With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection .NumberFormat = "General" .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom End With With Selection.Font .Name = "Arial" .Size = 8 .Bold = False .ColorIndex = xlAutomatic End With With Selection.Interior .ColorIndex = 15 .Pattern = xlSolid End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
getting rid of selection for formatting
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying Formatting - 'Selection Too Large' | Excel Discussion (Misc queries) | |||
Formatting Selection of cells. | Excel Discussion (Misc queries) | |||
center across selection formatting | Excel Discussion (Misc queries) | |||
Conditional Formatting and selection | Excel Discussion (Misc queries) | |||
Formatting a ComboBox selection | Excel Programming |