View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Roger[_22_] Roger[_22_] is offline
external usenet poster
 
Posts: 9
Default My macro won't find the last row !

This is the code that I am using. When I run it still get an error on the
line .LR = .Cells(Rows.Count, "H").End(xlUp).Row + 1. Any ideas ?? It just
does not want to count the rows to determine which row is the last row in
the table of data ! thanks ... Roger


With Worksheets("Report (zonderArb)")
..LR = .Cells(Rows.Count, "H").End(xlUp).Row + 1
..Range("H" & LR).Formula = "=sum(h1:h" & LR + 1 & ")"
..Range("H" & LR).Copy Range(.Cells(LR, "I"), .Cells(LR, "ae"))
..Range(.Cells(LR, "A"), .Cells(LR, "g")).Borders.LineStyle = xlContinuous
..Range(.Cells(LR, "h"), .Cells(LR, "o")).Borders.LineStyle = xlContinuous
..Range(.Cells(LR, "p"), .Cells(LR, "w")).Borders.LineStyle = xlContinuous
..Range(.Cells(LR, "x"), .Cells(LR, "ae")).Borders.LineStyle = xlContinuous
..Range("AF" & LR).Borders.LineStyle = xlContinuous

..Range(.Cells(l4, "M"), .Cells(LR, "n")).NumberFormat = "0.00"
..Range(.Cells(l4, "u"), .Cells(LR, "v")).NumberFormat = "0.00"
..Range(.Cells(l4, "ac"), .Cells(LR, "ad")).NumberFormat = "0.00"
..Range("G" & LR) = "Totals"

With Range("G" & LR).Characters(Start:=1, Length:=7).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With

End With

'Sheets("Instructions").Select
' Range("K61").Select
ActiveWorkbook.Save
End Sub