Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
stu stu is offline
external usenet poster
 
Posts: 4
Default entering formulas on a sheet

Hi

I have a sheet which is created from a search of a much larger sheet. the
number of rows can vary from 1 to XXX. I would like to do a sum of the
columns and have it placed on the next empty row. I have tried using the
..formula = "=sum(c3:C"+variable+")" in a loop but just get mismatch errors.
any help would be gratefully appreciated.

Regards

Stu


  #3   Report Post  
Posted to microsoft.public.excel.programming
stu stu is offline
external usenet poster
 
Posts: 4
Default entering formulas on a sheet

It doesn't matter where I put it. The problem I am having is getting the
formula =sum(c3:CXXX) where for that column XXX is unknown until the sheet
has been created by a search and copy/paste macro.

Stuart

"Don Guillett" wrote in message
...
Wouldn't it just be easier to put the sum at the top?

--
Don Guillett
SalesAid Software

"stu" wrote in message
s.com...
Hi

I have a sheet which is created from a search of a much larger sheet.

the
number of rows can vary from 1 to XXX. I would like to do a sum of the
columns and have it placed on the next empty row. I have tried using the
.formula = "=sum(c3:C"+variable+")" in a loop but just get mismatch

errors.
any help would be gratefully appreciated.

Regards

Stu






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default entering formulas on a sheet

sub SetupSums()
Dim rng as Range
for i = 1 to 10
set rng = cells(rows.count,i).End(xlup)(2)
rng.FormulaR1C1 = "=Sum(R3C:R[-1]C)"
Next
End Sub

change 10 to the number of columns to process.


"stu" wrote in message
s.com...
Hi

I have a sheet which is created from a search of a much larger sheet. the
number of rows can vary from 1 to XXX. I would like to do a sum of the
columns and have it placed on the next empty row. I have tried using the
.formula = "=sum(c3:C"+variable+")" in a loop but just get mismatch

errors.
any help would be gratefully appreciated.

Regards

Stu




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default entering formulas on a sheet

if you want it at the top, then you don't care where the bottom is

Range("A1:M1").Formula = "=Sum(A3:A65536)"

--
regards,
tom Ogilvy

"stu" wrote in message
s.com...
It doesn't matter where I put it. The problem I am having is getting the
formula =sum(c3:CXXX) where for that column XXX is unknown until the sheet
has been created by a search and copy/paste macro.

Stuart

"Don Guillett" wrote in message
...
Wouldn't it just be easier to put the sum at the top?

--
Don Guillett
SalesAid Software

"stu" wrote in message
s.com...
Hi

I have a sheet which is created from a search of a much larger sheet.

the
number of rows can vary from 1 to XXX. I would like to do a sum of the
columns and have it placed on the next empty row. I have tried using

the
.formula = "=sum(c3:C"+variable+")" in a loop but just get mismatch

errors.
any help would be gratefully appreciated.

Regards

Stu








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
Entering Formulas Justme Excel Worksheet Functions 6 August 14th 08 10:05 AM
Entering Formulas Rey Excel Discussion (Misc queries) 5 August 8th 07 08:40 PM
Entering Formulas Nickydad Excel Worksheet Functions 2 September 20th 06 02:12 AM
Entering formulas Nickydad Excel Worksheet Functions 1 September 20th 06 12:11 AM
entering formulas Tara Martin Excel Worksheet Functions 1 April 6th 06 07:33 PM


All times are GMT +1. The time now is 05:01 AM.

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"