LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Converting IF Formul To VBA

Why do you want to change it to VBA?

When you say apply it to B3:B102, how does each of those cells relate to
that formula. For example, if that formula is in B3, the formula in B4 would
be

IF((AND(S53,V50,U5="A3")),"A1",(IF((OR(W5<AM5,$A E$3<12,AA59)),"a1",IF((AN
D(S510,AA51)),"A1",IF(S53,"A2","")))))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LoveCandle" wrote
in message ...

Hi everybody,

I have this IF Formula and I want to convert it to VBA code to get the
same purpose,



Code:
--------------------

IF((AND(S43,V40,U4="A3")),"A1",(IF((OR(W4<AM4,$A E$3<12,AA49)),"a1",IF((AN
D(S410,AA41)),"A1",IF(S43,"A2","")))))
--------------------


Actually, I tried this code but it didn't work properly with me I
don't know the error exactly.


Code:
--------------------
Private Sub Worksheet_Change(ByVal Target As Range)
If (Range("S" & Target.Row).Value 3 And Range("V" & Target.Row).Value
0 And Range("U" & Target.Row).Value = "A3") _
Or (Range("W" & Target.Row).Value < Range("AM" & Target.Row).Value Or

Range("AE" & Target.Row).Value < 12 Or Range("AA" & Target.Row).Value 9) _
Or (Range("S" & Target.Row).Value 10 And Range("AA" &

Target.Row).Value 1) Then
Range("B" & Target.Row).Value = "A1"
ElseIf Range("S" & Target.Row).Value 3 Then
Range("B" & Target.Row).Value = "A2"
Else: Range("B" & Target.Row).Value = ""
Exit Sub
End If
End Sub
--------------------


So, I would like you please to help me to get the formuls working in
range B3:B102 only.

Thanks for all.


--
LoveCandle
------------------------------------------------------------------------
LoveCandle's Profile:

http://www.excelforum.com/member.php...o&userid=28612
View this thread: http://www.excelforum.com/showthread...hreadid=486751



 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to not get '0' or '#DIV/0!' in a cell with a percentage formul Rum Excel Worksheet Functions 7 June 30th 09 06:06 PM
formul [email protected] Excel Discussion (Misc queries) 0 March 6th 08 08:47 PM
creating a formul George A. Yorks Excel Discussion (Misc queries) 43 October 13th 06 10:36 PM
IF Formul This is a homework Excel Worksheet Functions 1 October 30th 05 07:35 PM
formul that add 1.5 day, every end of month how to add 1.5 day every end of mon Excel Discussion (Misc queries) 2 April 20th 05 10:48 AM


All times are GMT +1. The time now is 04:58 PM.

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

About Us

"It's about Microsoft Excel"