Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting formula
You can do it in one operation, like so
Range("M1:N25").Formula="=IF($Q198=R$37,$N198,0)" -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Antonio" wrote in message ... I need to insert programmatically the following formula in several adjacent cells =IF($Q198=R$37,$N198,0) 198 is the row number that varies R is the column letter that varies The rest is constant I cannot copy the cells from above because sometimes I am not supposed to. Copying the cells from above manually does work. I am trying: .Cells(r, 18).Formula = "=IF($Q" & r & "=" & Column() & "$37" & ",$N" & r & ",0)" where r is the row number I need to figure out the column() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting Formula | Excel Discussion (Misc queries) | |||
Inserting formula | Excel Programming | |||
inserting formula | Excel Programming | |||
inserting a formula | Excel Discussion (Misc queries) | |||
Formula changes while inserting a row !!!! | Excel Worksheet Functions |