Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Sum unknown length column data in VBA

All, I really appreciate the help from this group of talented people.

I want to add a formula in the 6th column, one row after the bottom
row of data, summing from F5 to F "bottom".
I know I'm close, but something here is wrong.

Sub ColTots()

Dim z As Long
Dim bottom As Long

bottom = Cells(Rows.Count, "B").End(xlUp).Row
z = bottom + 1

cells(z,6).formula = "=SUM("F5:F" & bottom)"


Thanks
john
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Sum unknown length column data in VBA

Hi John,

Try:

Cells(z, 6).Formula = "=SUM(F5:F" & bottom & ")"


---
Regards,
Norman


"John" wrote in message
...
All, I really appreciate the help from this group of talented people.

I want to add a formula in the 6th column, one row after the bottom
row of data, summing from F5 to F "bottom".
I know I'm close, but something here is wrong.

Sub ColTots()

Dim z As Long
Dim bottom As Long

bottom = Cells(Rows.Count, "B").End(xlUp).Row
z = bottom + 1

cells(z,6).formula = "=SUM("F5:F" & bottom)"


Thanks
john



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Sum unknown length column data in VBA


Sub Macro1()
'
' Macro1 Macro
'
Range("F5").End(xlDown).Name = "finish"
Range("finish").Offset(1, 0).Formula = "=SUM
(f5:finish)"
End Sub



-----Original Message-----
All, I really appreciate the help from this group of

talented people.

I want to add a formula in the 6th column, one row after

the bottom
row of data, summing from F5 to F "bottom".
I know I'm close, but something here is wrong.

Sub ColTots()

Dim z As Long
Dim bottom As Long

bottom = Cells(Rows.Count, "B").End(xlUp).Row
z = bottom + 1

cells(z,6).formula = "=SUM("F5:F" & bottom)"


Thanks
john
.

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
Finding a string of unknown length in a string of unknown length, Help! Hankjam[_2_] Excel Discussion (Misc queries) 8 July 3rd 08 06:49 PM
How to sort column data regardless of col length JBW Excel Worksheet Functions 2 November 26th 07 10:40 AM
SMALL() on unknown length of list [email protected] Excel Worksheet Functions 9 November 1st 06 02:03 PM
How do I sort a large column of data by length? blange Excel Worksheet Functions 3 May 29th 06 08:35 PM
How I type SOLD across column length without changing current data MommaRMe Charts and Charting in Excel 1 May 19th 05 09:11 AM


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