error with macro

P

parteegolfer

I am tring to apply this code which should locate and apply 2 rows below
the last entry in the worksheet. I am getting an error in the colored
command and can't figuire out why. can someone help please?






Code:
--------------------
Sub test()
Dim LastR As Range, rng As Range
Set LastR = Range("c" & Rows.Count).End(xlUp)
Set LastR = LastR.Offset(, -2)
Set rng = Union(LastR.Offset(2).Resize(2, 2), LastR.Offset(2, 2).Resize(2, 2), _
LastR.Offset(2, 4).Resize(2, 2), LastR.Offset(2, 6).Resize(2, 2))
rng.Borders.Weight = xlThick
rng.Offset(3).Borders.Weight = xlThick
With LastR.Offset(2)
.Value = "TOTAL CUSTOMERS"
.Font.Bold = True
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.Offset(, 2).Value = "TOTAL $95.00"
.Offset(, 4).Value = "TOTAL $145.00"
.Offset(, 6).Value = "FREE SERVICE"
.Offset(3, 2).Value = "PERCENT $95.00 CALLS"
.Offset(3, 4).Value = "PERCENT $145.00 CALLS"
.Offset(3, 6).Value = "PERCENT FREE"
End With
Set rng = Nothing
End Sub
 
G

Guest

What do you mean by "colored command"? There is reference having anything to
do with color in the posted code.

Regards,
Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top