# Posts by Natit1

• ## Sum with dynamic cells

The second option worked great

this one - (Range("r1").FormulaR1C1 = "=sum(R1C1:R" & Lrow & "C" & Lcol & ")")

• ## Sum with dynamic cells

Sorry, but it doesn't work

The sheet is attached here.

• ## Sum with dynamic cells

HI,

Can someone help and will tell me what's wrong with this command:

Code
1. Range("r1") = "=sum(" & Range(Cells(1, 1), Cells(Lrow, Lcol)) & ")"

Thanks

Nati

• ## Formula with relative columns

relative to the number of columns .

In the example the columns are "d" (this column is always the first, so it is fixed for me) to "o", which means from 4 to 15.

But sometimes I'll have the data till column "s" or to "z", and I want the formula to be flexible of course (I know the number of the the last column)

Hope it is clear know

Thx

• ## Formula with relative columns

Hi,

I would like to fit this code:

Range("start!b14").Formula = "=sumif(data" & "!\$D\$2:\$O\$" & Lrow & ",""<0"")"

to work with relative columns (instead of the fix one here)

Tia

Nati

• ## Sumifs with true/false

I know the process with the OptionBox.

I need the formula that gives the result according the data from the OptionBox (which gives me the column number) and the years selected (which are the True and the False)

• ## Sumifs with true/false

The column number (5 in this case) selected by OptioBox which the user select in another sheet.

Example:

1. If year 2018="True" and 2019&2020 = "False", and column 5 is selected (meaning Data5 - I know that the absolute column is 8 ), the result for Unit1 will be - 58

2. If year 2018="True" and 2019 = "True" and 2020 = "False", and column 2 is selected, the result for Unit1 will be - 192

and so on..

• ## Sumifs with true/false

Great

Thanks

And I have A little more complexed need.

How do I sum according to sumif that you answered me, but this time with selecting specific column.

to-ozgrid-forum.xlsx

• ## Sumifs with true/false

Hi,

I'm looking for the formula that will sum each data column (in the result line)to-ozgrid-forum.xlsxto-ozgrid-forum.xlsx according to the status column (means that if the line status is true, the sum will be added, if false then not added)

Tia

Nati

• ## Sum within a cell

Just what I needed.

Thanks a lot

• ## Sum within a cell

Ooops

Here is the sheet

• ## Sum within a cell

Hi 2 u all,

Need help in how to write the next code line in VBA (what is suppose to be in the question marks of course):

lrow = 24

for i = 1 to 3

cells(lrow +1, i) = "sum(????????????????)"

next i

TIA

Nati