D
Don Guillett
I'm still curious as to what's wrong with my shorter code?
--
Don Guillett
SalesAid Software
(e-mail address removed)
--
Don Guillett
SalesAid Software
(e-mail address removed)
Otto Moehrbach said:Joe
Here is the code to do it all as well as repeat the header row in the
top row of every range. HTH Otto
Option Explicit
Dim RngG As Range
Dim i As Range
Dim FirstCell As Range
Dim LastCell As Range
Dim TheRng As Range
Sub NEWSHT2()
Set RngG = Range("G1:G65536")
If [G1].Value <> "Remarks" Then
Set FirstCell = Range("G1")
Else
For Each i In RngG
If i.Borders(xlEdgeLeft).LineStyle = xlNone Then Exit For
Next i
Set FirstCell = i
End If
Set LastCell = Range(FirstCell, FirstCell.Offset(20, 6))
Set TheRng = Range(FirstCell, LastCell)
Call PutBorders
End Sub
Sub IntitialSetup()
TheRng(1).EntireRow.RowHeight = 20
TheRng(1).Value = "Remarks"
TheRng(2).Value = "Proposed" & Chr(10) & "Elevation"
TheRng(3).Value = "Existing" & Chr(10) & "Elevation"
With TheRng(2).Resize(, 2).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
End With
TheRng(4).Value = "Diff."
TheRng(5).Value = "Fill"
TheRng(6).Value = "Cut"
TheRng(7).Value = "Description"
TheRng(1).EntireRow.AutoFit
Range("M:M,G:G").ColumnWidth = 20
Columns("H:I").ColumnWidth = 12
End Sub
Sub PutBorders()
Call IntitialSetup
With TheRng
.Borders.LineStyle = xlContinuous
.Borders.Weight = xlThin
.BorderAround LineStyle:=xlContinuous, Weight:=xlThick
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
End With
With TheRng(1).Resize(, 7)
.BorderAround LineStyle:=xlContinuous, Weight:=xlThick
End With
TheRng(1).Select
End Sub
Joe said:Don and Otto, Thanks for your help. I will try the new macros today.
Otto,
Sorry I took so long to reply, I would like the Text from row 1 to also
drop down with the rest of the formatting. I mean I would like the
headers to
be at the top row of everyrange. Thanks again.