LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default setting formula property

for x = var1 to var2
With myWorksheet
.cells(row_num1, x).formula = _
"=sum(" .Range(.Cells(row_num2,x),.Cells(row_num3,x)) _
.Address(0,0) & ")
End With
next


--
Regards,
Tom Ogilvy



Ed Stevens wrote in message
om...
I could have sworn I asked this hear a year or so ago (and that's
about as often as I have to write some Excel macros), but a search of
the archives didn't turn it up. I'm also not able to find what I'm
looking for on MSDN, though I'm sure it can be done.

Need is to set a column total into a range of cells. This pseudo code
demonstrates what I'm after

for x = var1 to var2
myWorksheet.cells(row_num1, x).formula =
"sum((row_num2,x):(row_num3,x))"

next


basic point is I need the loop to step me from column to column, and
set up a sum of some rows in that column, but I won't know the column
by its letter name.



 
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
unable to set the formula array property of the range class JLP Excel Worksheet Functions 3 November 18th 08 10:54 PM
cancelling getpivot formula when setting formula outside pivot ta. cancelling getpivot formula Excel Worksheet Functions 2 October 31st 06 10:31 PM
Unable to set the formula property of the series class Malhar Charts and Charting in Excel 1 July 24th 06 05:50 PM
setting XValues property when charting using macros rhsiao Charts and Charting in Excel 3 April 7th 06 04:16 PM
Error setting shape text property Sarge Charts and Charting in Excel 2 January 11th 06 03:31 AM


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

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"