Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't understand why vb doesn't like this formula. Please help me
see what I am overlooking... Dim Last_Column As Range Set Last_Column = Worksheets(sName).Range("T2:T10") Last_Column.Formula = "=IF(OR(" _ AND(" & Min_Limit & "<=Q2," & Max_Limit & "=Q2), _ AND(" & Min_Limit & "<=R2," & Max_Limit & "=R2), _ AND(" & Min_Limit & "=Q2," & Max_Limit & "<=R2)),1,0)" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
double quotations needed? ("""")
|
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Where?
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Where? What's the difference between single and double?
Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
^ Please disregard the previous comment. It looks like there was a lag
in posting that comment. Thanks Tom and Bob! |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() When trying to write a formula to a cell you need to double up on your quotations Last_Column.Formula = "=IF(OR(*""* _ AND(*""* & Min_Limit & *""*<=Q2,"" & Max_Limit & *""*=Q2), _ AND(*""* & Min_Limit &* ""*<=R2,*"" *& Max_Limit &* ""*=R2), _ AND(*""* & Min_Limit & *""*=Q2,*""* & Max_Limit & *""*<=R2)),1,0)" When it puts the Formula in the cell it will remove the additional quotes. remember only double quotes for the formula that will be in the cell not around the formula. Hope THis Helps -- Xiazer ------------------------------------------------------------------------ Xiazer's Profile: http://www.excelforum.com/member.php...o&userid=31581 View this thread: http://www.excelforum.com/showthread...hreadid=542483 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, I changed to the following, but I'm still getting an error...?
Last_Column.Formula = "=IF(OR( _ AND("" & RF_Min_Limit & ""<=Q2,"" & RF_Max_Limit & ""=Q2), _ AND("" & RF_Min_Limit & ""<=R2,"" & RF_Max_Limit & ""=R2), _ AND("" & RF_Min_Limit & ""=Q2,"" & RF_Max_Limit & ""<=R2)),1,0)" |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't think it is double quotes that you need as I think Min_Limit and
Max_Limit are numbers. Try Dim Last_Column As Range Set Last_Column = Worksheets(sname).Range("T2:T10") Last_Column.Formula = "=IF(OR(" & _ "AND(" & Min_Limit & "<=Q2," & Max_Limit & "=Q2)," & _ "AND(" & Min_Limit & "<=R2," & Max_Limit & "=R2)," & _ "AND(" & Min_Limit & "=Q2," & Max_Limit & "<=R2)),1,0)" -- HTH Bob Phillips (remove xxx from email address if mailing direct) "DISMfish" wrote in message oups.com... Ok, I changed to the following, but I'm still getting an error...? Last_Column.Formula = "=IF(OR( _ AND("" & RF_Min_Limit & ""<=Q2,"" & RF_Max_Limit & ""=Q2), _ AND("" & RF_Min_Limit & ""<=R2,"" & RF_Max_Limit & ""=R2), _ AND("" & RF_Min_Limit & ""=Q2,"" & RF_Max_Limit & ""<=R2)),1,0)" |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, that did it!
|
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, that did it!
|
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, that did it!
|
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can't put a continuation character inside a string
s = "ABC _ EFG" doesn't work. s = "ABC" & _ "EFG" -- Regards, Tom Ogilvy "DISMfish" wrote: Ok, I changed to the following, but I'm still getting an error...? Last_Column.Formula = "=IF(OR( _ AND("" & RF_Min_Limit & ""<=Q2,"" & RF_Max_Limit & ""=Q2), _ AND("" & RF_Min_Limit & ""<=R2,"" & RF_Max_Limit & ""=R2), _ AND("" & RF_Min_Limit & ""=Q2,"" & RF_Max_Limit & ""<=R2)),1,0)" |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Last_Column.Formula = "=IF(OR(" & _
"AND(" & Min_Limit & "<=Q2," & Max_limit & "=Q2)," & _ "AND(" & Min_Limit & "<=R2," & Max_limit & "=R2)," & _ "AND(" & Min_Limit & "=Q2," & Max_limit & "<=R2)),1,0)" HTH -- AP "DISMfish" a écrit dans le message de news: ... I don't understand why vb doesn't like this formula. Please help me see what I am overlooking... Dim Last_Column As Range Set Last_Column = Worksheets(sName).Range("T2:T10") Last_Column.Formula = "=IF(OR(" _ AND(" & Min_Limit & "<=Q2," & Max_Limit & "=Q2), _ AND(" & Min_Limit & "<=R2," & Max_Limit & "=R2), _ AND(" & Min_Limit & "=Q2," & Max_Limit & "<=R2)),1,0)" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula | Excel Worksheet Functions | |||
Commenting custom formula fields/formula on formula editor | Excel Programming |