LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default using variables in formula in R1C1 mode

Does someone has a solution for the next problem
My worksheet is put in R1C1 mode
and I am working with a Database on worksheet ("Database")

I have made a selection of the unique values in Column 11 in ("Database")
and I pasted this range temporarily under the database to perform
first a formule "Sumif" on this range by using a "Do...Loop" method
When this is done, I wil select both and copy them to another worksheet
and use it as a rapport.



The formula with the problem is...

1

Cells(Lastrow + 10, Colindex +1).Select

2
Do
Crit1 = ActiveCell.Offset(0,-1).text
ActiveCell.Formula = "=SUMIF(CC1:CC2, Crit1 ,CC3:CC4)"
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -1))

( The first part is the selection of the first cell to start
the loop.
Crit1 is a unique value and CC1,CC2,CC3,CC4 are the different
variables for the
Cells in the Range to use in the formula.
)

when ever I perform this code the result is

Unique value sum
albert heijn 0
aldi 0
alex 0
ecc.......

( when I change (as a test) the Sumif formula to something more simple
like ActiveCell.Formula = CC4 * CC3
it is working fine.......)

what am I doing wrong?


Thanks in advance....
Domin


 
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
R1C1 formula question igorek Excel Worksheet Functions 2 October 5th 07 02:58 AM
R1C1 Formula in Excel Barb Reinhardt Excel Worksheet Functions 2 December 8th 05 02:40 PM
Variable in an R1C1 formula kptheop Excel Programming 1 October 23rd 04 12:18 AM
Wow can I switch to R1C1 mode? y Excel Programming 1 April 9th 04 12:34 PM
looping formula - r1c1 problem MDC[_2_] Excel Programming 2 October 22nd 03 11:13 PM


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