#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Add formula if

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!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Add formula if

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.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"puiuluipui" wrote:

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!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Add formula if

Hi Luke, thanks for everything, but i need something like this.:
Intersect(ActiveSheet.UsedRange.Columns("G").Speci alCells(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!

"Luke M" wrote:

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.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"puiuluipui" wrote:

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!

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 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"