Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need to have the following code enter via VBA into a cell:
=IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Range("A1").formula= "=IF(AH6=" & Chr(34) & "Active" & Chr(34) & "," &
Chr(34) & chr(34) & ",AH6)" If this post helps click Yes --------------- Jacob Skaria "Tony" wrote: I need to have the following code enter via VBA into a cell: =IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Record a macro while entering the formula manually.
HTH. Best wishes Harald "Tony" wrote in message ... I need to have the following code enter via VBA into a cell: =IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi
try this.. wsPh.Range("ah" & Emcnt).Formula = _ "=if(AH" & Emcnt & " =""Active"","",AH" & Emcnt & ")" REgards FSt1 "Tony" wrote: I need to have the following code enter via VBA into a cell: =IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Range("A1").formula= "=IF(AH6=""Active"","""",AH6)"
If this post helps click Yes --------------- Jacob Skaria "Tony" wrote: I need to have the following code enter via VBA into a cell: =IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Your statement came closest to the text formula I was using, but I am
receiving a run time 1004 error when I run the code. Any suggestions? "FSt1" wrote: hi try this.. wsPh.Range("ah" & Emcnt).Formula = _ "=if(AH" & Emcnt & " =""Active"","",AH" & Emcnt & ")" REgards FSt1 "Tony" wrote: I need to have the following code enter via VBA into a cell: =IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
opps. my bad.
wsPh.Range("ah" & emcnt).Formula = _ "=IF(AH" & emcnt & " =""Active"","""",AH" & emcnt & ")" i forgot to put quotes around the quotes for the then part. sorry. regards FSt1 "Tony" wrote: Your statement came closest to the text formula I was using, but I am receiving a run time 1004 error when I run the code. Any suggestions? "FSt1" wrote: hi try this.. wsPh.Range("ah" & Emcnt).Formula = _ "=if(AH" & Emcnt & " =""Active"","",AH" & Emcnt & ")" REgards FSt1 "Tony" wrote: I need to have the following code enter via VBA into a cell: =IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
That works like a charm. Much appreciated!
Tony "FSt1" wrote: opps. my bad. wsPh.Range("ah" & emcnt).Formula = _ "=IF(AH" & emcnt & " =""Active"","""",AH" & emcnt & ")" i forgot to put quotes around the quotes for the then part. sorry. regards FSt1 "Tony" wrote: Your statement came closest to the text formula I was using, but I am receiving a run time 1004 error when I run the code. Any suggestions? "FSt1" wrote: hi try this.. wsPh.Range("ah" & Emcnt).Formula = _ "=if(AH" & Emcnt & " =""Active"","",AH" & Emcnt & ")" REgards FSt1 "Tony" wrote: I need to have the following code enter via VBA into a cell: =IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
you're welcome. glad to help.
regards FSt1 "Tony" wrote: That works like a charm. Much appreciated! Tony "FSt1" wrote: opps. my bad. wsPh.Range("ah" & emcnt).Formula = _ "=IF(AH" & emcnt & " =""Active"","""",AH" & emcnt & ")" i forgot to put quotes around the quotes for the then part. sorry. regards FSt1 "Tony" wrote: Your statement came closest to the text formula I was using, but I am receiving a run time 1004 error when I run the code. Any suggestions? "FSt1" wrote: hi try this.. wsPh.Range("ah" & Emcnt).Formula = _ "=if(AH" & Emcnt & " =""Active"","",AH" & Emcnt & ")" REgards FSt1 "Tony" wrote: I need to have the following code enter via VBA into a cell: =IF(AH6="Active","",AH6) I tried using the following but received an error: wsPh.Range("ah" & Emcnt).Formula = "=if(ah" & Emcnt & ="Active"","" & ,"ah" & Emcnt"")" Can someone help me out here? Also, is there somewhere where I can see the actual code format such a statement? Many thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I make a blank cell in a formula cell with a range of cell | Excel Discussion (Misc queries) | |||
copy formula down a column and have cell references change within formula | New Users to Excel | |||
adding a formula in a cell but when cell = 0 cell is blank | Excel Worksheet Functions | |||
Cell Formula reference to cell Based On third Cell Content | Excel Discussion (Misc queries) | |||
Cell Formula reference to cell Based On third Cell Content | Excel Discussion (Misc queries) |