Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Borders/Inserting Lines
Sub ABCD()
k = 5 For m = 1 To 20 With Worksheets("Change") With .Cells(k + 2, m).Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With End With Next End Sub for the blank line, change k = k + 3 to k = k + 4 -- Regards, Tom Ogilvy "teresa" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting Lines or Copying lines with formulas but without data | Excel Discussion (Misc queries) | |||
My borders show up as dashed lines. Why? | Excel Discussion (Misc queries) | |||
Removing lines and/or borders | Excel Discussion (Misc queries) | |||
HOW DO I ADD LINES AND BORDERS IN ASPREADSHEET | Excel Discussion (Misc queries) | |||
Grid Lines vs. Borders | Excel Programming |