View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Teresa Teresa is offline
external usenet poster
 
Posts: 169
Default Borders/Inserting Lines

I have a couple of issues with my code:
1) Putting the borders in , my code to do this is asterisked below, doesnt run
2)Also need to insert a line btw each account in Changes.xls

Thanks A Million


I want to get from:

Jobs.xls:

Client Jan Feb Mar
GATT 100 150 250
CHEV 99 200 400


Jobs2.xls:

Client Jan Feb Mar
GATT 200 250 350
CHEV 199 300 1000


i NEED TO GET TO:

Changes.XLS

Client Jan Feb Mar
GATT 200 250 350
100 150 250
-------------------------------
100 100 100

CHEV 199 300 1000
99 200 400
-------------------------------
100 100 600



Sub des()

Worksheets.Add.Name = "Changes"

k = 2
For i = 1 To 20
For j = 1 To 20
If Worksheets("Jobs").Cells(i, j) <
Worksheets("Jobs2").Cells(i, j) Then
Worksheets("Jobs2").Cells(i, j).EntireRow.Copy _
Destination:=Worksheets("Changes").Cells(k, 1)
Worksheets("Jobs").Cells(i, j).EntireRow.Copy _
Destination:=Worksheets("Changes").Cells(k + 1, 1)
With Worksheets("Changes")
.Cells(k + 1, 1).ClearContents
For m = 2 To 20
.Cells(k + 2, m).Value = .Cells(k, m) - .Cells(k + 1, m)
* .Cells(k + 2, m).borders (xlEdgeBottom)
* .Cells(k + 2, m).LineStyle = xlContinuous
* .Cells(k + 2, m).Weight = xlMedium
* .Cells(k + 2, m).ColorIndex = xlAutomatic
Next m
End With
k = k + 3
Exit For
End If
Next j
Next i

End Sub