Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default bottom borders in a For Loop

Newbie here, hope you can help

snippet of code below - it puts the subtotal in col c and works good

However I also want a bottom border line to go across col B thru G ONLY on
the suttotal line

I know others may write the code differently but this is my first attempt.
Just looking for a line or so that will hopefully do the trick
Any help appreciated - Thanks Chris


Dim rng As Range, code As Variant
Dim i As Integer
Dim qty As Integer

Set rng = Range("b4:b50")
code = Range("b4").Value
For i = 1 To rng.Count

If code < rng.Cells(i).Value Then
code = rng.Cells(i).Value
rng.Cells(i).Offset(-1, 2).Value = qty
qty = rng.Cells(i).Offset(0, 1).Value

b c d e f g
code amt subtotal
a 23
a 5 28
b 6
b 66
b 58 130
c 9
c 14 23
d 48
d 45
d 8
d 95 196


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
Loop a range from bottom up Who I Am Excel Programming 3 July 21st 06 07:51 PM
dislike jump bottom of column by double-clicking the bottom of cel Joe Excel Discussion (Misc queries) 1 April 9th 06 09:27 PM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
how to paste data from top to bottom to bottom to top Dave Peterson Excel Discussion (Misc queries) 0 January 25th 05 12:12 AM


All times are GMT +1. The time now is 11:14 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"