|
-
Jun 22nd, 2000, 03:28 AM
#1
Thread Starter
Addicted Member
Private Sub Workbook_Open()
Dim stRangeCol As String
Dim intRangeRowBegin As Integer
Dim intRangeRowEnd As Integer
Dim Pos As String
Dim intloc As Integer
Dim intc As Integer
Application.DisplayAlerts = False
ActiveCell.CurrentRegion.Select
stRangeCol = "a"
intRangeRowBegin = 7
Pos = stRangeCol & intRangeRowBegin
Range(Pos).Select
If ActiveCell.Value <> Empty Then
intc = intRangeRowBegin
Do Until ActiveCell.Value = Empty
Pos = "A" & intc
Range(Pos).Select
intc = intc + 1
Loop
intRangeRowEnd = intc - 2
Pos = "A" & intRangeRowEnd
Range(Pos).Select
If ActiveCell.Value <> "Saturday" Then
intRangeRowBegin = intc - 7
Else
intRangeRowBegin = intc - 6
End If
Pos = "A" & intRangeRowBegin & ":A" & intRangeRowEnd
Range(Pos).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Interior
.ColorIndex = 19
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Pos = "A" & intRangeRowBegin & ":L" & intRangeRowEnd
Range(Pos).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
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.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
End Sub
can someone take this apart and tell me what it is doing line by line; please thanks!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|