Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a sheet I am trying to add a formula to a different column if
the value in column 1 is either FAO or FVA. Then I have a subset of formula to add...if it does not meet this criteria..then it needs to skip it. It needs to continue to run thru the rows until Col 1 is blank. The calculation formula works fine...just not at the appropriate time (hence my request for help) So in plain language I would like for this to happen Check column 1 if value = FVA or FAO then Range("M2").Select ActiveCell.FormulaR1C1 = "=RC[-7]*0.084" Range("N2").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-8]:RC[-1])" Range("O2").Select ActiveCell.FormulaR1C1 = "=RC[-10]-RC[-1]" 'Range("M2:O2").Select If value = anything else then skip Continue until column 1 = blank Any help would be greatly appreciated |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should be close...
Sub test() Dim rng As Range Dim rngToSearch As Range With Sheets("Sheet1") Set rngToSearch = .Range(.Range("A2"), _ .Cells(Rows.Count, "A").End(xlUp)) End With For Each rng In rngToSearch With rng If .Value = "FVA" Or .Value = "FAO" Then Cells(.Row, "M").FormulaR1C1 = "=RC[-7]*0.084" Cells(.Row, "N").FormulaR1C1 = "=SUM(RC[-8]:RC[-1])" Cells(.Row, "O").FormulaR1C1 = "=RC[-10]-RC[-1]" End If End With Next rng End Sub -- HTH... Jim Thomlinson "JenIT" wrote: I have a sheet I am trying to add a formula to a different column if the value in column 1 is either FAO or FVA. Then I have a subset of formula to add...if it does not meet this criteria..then it needs to skip it. It needs to continue to run thru the rows until Col 1 is blank. The calculation formula works fine...just not at the appropriate time (hence my request for help) So in plain language I would like for this to happen Check column 1 if value = FVA or FAO then Range("M2").Select ActiveCell.FormulaR1C1 = "=RC[-7]*0.084" Range("N2").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-8]:RC[-1])" Range("O2").Select ActiveCell.FormulaR1C1 = "=RC[-10]-RC[-1]" 'Range("M2:O2").Select If value = anything else then skip Continue until column 1 = blank Any help would be greatly appreciated |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The day was crazy and I have not had a chance to give it a try. It
looks like I was just missing a couple of things. I will try on Monday and let you know. Thanks for the help. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This works great!!! Thank you for your help!!!
Consider the question closed |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Looking for a formula to perform this additions | Excel Discussion (Misc queries) | |||
How do I perform a different formula on the same cell range? | Excel Worksheet Functions | |||
In Excel, how do I set a formula to skip a cell if zero? | Excel Discussion (Misc queries) | |||
What function does ^ perform in a formula | Excel Worksheet Functions | |||
Reference a Macro to perform Cell formula | Excel Discussion (Misc queries) |