Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Lines or Copying lines with formulas but without data wnfisba Excel Discussion (Misc queries) 2 August 18th 06 04:41 PM
My borders show up as dashed lines. Why? mannross Excel Discussion (Misc queries) 1 December 15th 05 09:59 PM
Removing lines and/or borders mystical_ways Excel Discussion (Misc queries) 1 August 9th 05 07:35 PM
HOW DO I ADD LINES AND BORDERS IN ASPREADSHEET RUDY Excel Discussion (Misc queries) 1 March 2nd 05 11:33 AM
Grid Lines vs. Borders Format Challenged Excel Programming 1 December 4th 03 08:29 PM


All times are GMT +1. The time now is 07:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"