Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Totaling range help needed

Good day all, i need some help modifing some code that i got of this
site to insert the total at the bottom of a column.

The code works great, i just need to format the cell with the total in
with code, making it bold and putting a single line on top and a double
line underneath and i do not know how to do it.

Sub Totals()
Dim eRow As Long
Dim fRow As Long
Dim lRow As Long
eRow = Cells(Rows.Count, 1).End(xlUp).Row
fRow = 4
Do Until lRow = eRow + 1
lRow = Cells(fRow, 10).End(xlDown).Row + 1
Cells(lRow, 10).FormulaR1C1 = _
"=SUM(R[-" & lRow - fRow & "]C:R[-1]C)"
fRow = lRow + 2
Loop
End Sub
Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Totaling range help needed

Don't forget the macro recorder to get the information you need.

Sub Totals()
Dim eRow As Long
Dim fRow As Long
Dim lRow As Long
eRow = Cells(Rows.Count, 1).End(xlUp).Row
fRow = 4
Do Until lRow = eRow + 1
lRow = Cells(fRow, 10).End(xlDown).Row + 1
With Cells(lRow, 10)
.Font.Bold = True
.FormulaR1C1 = _
"=SUM(R[-" & lRow - fRow & "]C:R[-1]C)"
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
fRow = lRow + 2
Loop
End Sub

--
Regards,
Tom Ogilvy



"Tempy" wrote in message
...
Good day all, i need some help modifing some code that i got of this
site to insert the total at the bottom of a column.

The code works great, i just need to format the cell with the total in
with code, making it bold and putting a single line on top and a double
line underneath and i do not know how to do it.

Sub Totals()
Dim eRow As Long
Dim fRow As Long
Dim lRow As Long
eRow = Cells(Rows.Count, 1).End(xlUp).Row
fRow = 4
Do Until lRow = eRow + 1
lRow = Cells(fRow, 10).End(xlDown).Row + 1
Cells(lRow, 10).FormulaR1C1 = _
"=SUM(R[-" & lRow - fRow & "]C:R[-1]C)"
fRow = lRow + 2
Loop
End Sub
Tempy

*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Totaling range help needed

Thanks a million Tom.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
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
Totaling Volume within a range of dates BuckeyeJohn21 Excel Worksheet Functions 3 December 23rd 09 07:44 PM
SUMIF with 2 ranges and 2 criteria's, totaling the same sum range. ADC76 Excel Discussion (Misc queries) 5 May 15th 09 11:47 AM
Formula for totaling occurrences in a specified range Valerie Excel Worksheet Functions 1 April 13th 07 08:16 PM
ranking in a dynamic range help needed?? barkiny Excel Worksheet Functions 2 May 15th 06 05:21 PM
Formula needed for date range klt Excel Programming 5 April 15th 05 11:43 PM


All times are GMT +1. The time now is 04:06 PM.

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

About Us

"It's about Microsoft Excel"