ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
Hi,
The code is supplied below,
All was working spot on until the code in Red was added.
Basically i recorded a macro and took the coede from there and placed it here.
What is hould do is the following.
Range A4:E30 add All borders "thats it"
But whilst you are there i would like to also add the All borderds to this range here,i didnt get around to that part as the above keep stopping me.
Range also to be included,
D31:E31
C35:C37
E35:E37
Thanks very much and have a nice day
The code is supplied below,
All was working spot on until the code in Red was added.
Basically i recorded a macro and took the coede from there and placed it here.
What is hould do is the following.
Range A4:E30 add All borders "thats it"
But whilst you are there i would like to also add the All borderds to this range here,i didnt get around to that part as the above keep stopping me.
Range also to be included,
D31:E31
C35:C37
E35:E37
Code:
Private Sub Worksheet_Activate()
With Sheets("GRASS INCOME")
.Range("A3") = UCase(Format(Now, "mmmm"))
.Range("D3") = Year(Now)
With .Range("A1:E3")
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With .Font
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.Name = "Calibri"
.FontStyle = "Bold"
.Size = 22
End With
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
With .Interior
.Pattern = xlSolid
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.PatternTintAndShade = 0
[COLOR=#ff0000] With Sheets("GRASS INCOME")[/COLOR]
[COLOR=#ff0000] .Range ("A4:E30")[/COLOR]
[COLOR=#ff0000] Selection.Borders(xlDiagonalDown).LineStyle = xlNone[/COLOR]
[COLOR=#ff0000] Selection.Borders(xlDiagonalUp).LineStyle = xlNone[/COLOR]
[COLOR=#ff0000] With Selection.Borders(xlEdgeLeft)[/COLOR]
[COLOR=#ff0000] .LineStyle = xlContinuous[/COLOR]
[COLOR=#ff0000] .ColorIndex = 0[/COLOR]
[COLOR=#ff0000] .TintAndShade = 0[/COLOR]
[COLOR=#ff0000] .Weight = xlThin[/COLOR]
[COLOR=#ff0000] End With[/COLOR]
[COLOR=#ff0000] Range("A5").Select[/COLOR]
[COLOR=#ff0000] End With[/COLOR]
[COLOR=#ff0000] End With[/COLOR]
[COLOR=#ff0000] End With[/COLOR]
[COLOR=#ff0000] End With[/COLOR]
End Sub
Thanks very much and have a nice day