Add formula if

P

puiuluipui

Hi, i need a macro to add a formula starting from "H2", but only if in "F"
colum are numbers.
Ex:
F H
12 formula
5 formula
empty no formula

If there are some numbers in "F" column, then to add formula in in "H"
column starting from "H2".
This is the formula: =IF(G2<>"",H2*G2,"")
Can this be done?
Thanks!
 
L

Luke M

First, that creates a circular reference (formula is in H2 and references
H2!) Is this intended?

Second, would this formula work?
=IF(ISBLANK(G2),"",H2*G2)

If not, you'd need to use a Workbook_Change event. You could prb modify one
of the previous example someone has posted for you on one of your other
threads.
 
P

puiuluipui

Hi Luke, thanks for everything, but i need something like this.:
Intersect(ActiveSheet.UsedRange.Columns("G").SpecialCells(2).EntireRow,
Columns("I2")).FormulaR1C1 = "=IF(RC[-2]<>"""",RC[-1]*RC[-2],"""")"

This macro is working ok, but i need to start looking and adding from row 2.
This macro is working from the begining of the columns. I need the macro to
work from row 2.
Can this be done?
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top