#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Help

I have code in an application I am developing which sums
the values in rows of data. The code is as follows:

Do While curRow <= maxRow

Set sumrng = Range(Cells(curRow, 2), Cells(curRow, rowNum))
SumItemWt = Application.WorksheetFunction.Sum(sumrng)
Worksheets(1).Cells(curRow, rowNum+ 1).Value2 = SumItemWt

curRow = curRow + 1

Loop

My users will enter data into the spreadsheet where each
column represents a record. In each column over the width
of my spreadsheet (I am using 22 columns) has a formula
which performs calculations on data entered above in each
column. When the code shown above runs, the formula in
each cell gets pushed down the column. This code runs on
12 rows. The formula in the cell that the command
Worksheets(1).Cells(curRow, rowNum+ 1).Value2 = SumItemWt
runs on is pushed down the column by 12 rows. Why! Should
this not just replace the existing formula whith the
SumItemWt value?

Any help will be greatly appreciated!

Kevin
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



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