Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF using VBA
I was wondering if you could help me with a little vba .. I have some code
that populates a summary page .. I am needed to change this part where it's populating the below code under quantity .Range("E10") = wsSource.Range("B5") Somehow I need it to populate .Range("E10") with a number based on another field so if wsSource.Range("B6")= "Quarterly in Arrears", .Range("B8"), Else ..Range("B9") How do I do that? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF using VBA
I am not sure what values you want where but the following is an example of
the If/Then/Else and you can substitue the ranges you require. If wsSource.Range("B6") = "Quarterly in Arrears" Then .Range("B8") = wsSource.Range("B5") Else .Range("B9") = wsSource.Range("B6") End If -- Regards, OssieMac "confused" wrote: I was wondering if you could help me with a little vba .. I have some code that populates a summary page .. I am needed to change this part where it's populating the below code under quantity .Range("E10") = wsSource.Range("B5") Somehow I need it to populate .Range("E10") with a number based on another field so if wsSource.Range("B6")= "Quarterly in Arrears", .Range("B8"), Else .Range("B9") How do I do that? Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF using VBA
hi,
You posted to little code to be precise but try this. I don't of course know what WITH statement you have enclosing this IF statement If wsSource.Range("B6") = "Quarterly in Arrears" Then .Range ("B8") Else .Range ("B9") End If Mike "confused" wrote: I was wondering if you could help me with a little vba .. I have some code that populates a summary page .. I am needed to change this part where it's populating the below code under quantity .Range("E10") = wsSource.Range("B5") Somehow I need it to populate .Range("E10") with a number based on another field so if wsSource.Range("B6")= "Quarterly in Arrears", .Range("B8"), Else .Range("B9") How do I do that? Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF using VBA
Thank you -- what if I want to add a message to another section -- it's
saying if Cell C5 has an amount greater than 13% then show this message at the bottom of the page. In If .Range("C5") = .Value "13%" Then With target "Message:Please contact the ABM for the specific extended net list price per part number." Else "" End If "OssieMac" wrote: I am not sure what values you want where but the following is an example of the If/Then/Else and you can substitue the ranges you require. If wsSource.Range("B6") = "Quarterly in Arrears" Then .Range("B8") = wsSource.Range("B5") Else .Range("B9") = wsSource.Range("B6") End If -- Regards, OssieMac "confused" wrote: I was wondering if you could help me with a little vba .. I have some code that populates a summary page .. I am needed to change this part where it's populating the below code under quantity .Range("E10") = wsSource.Range("B5") Somehow I need it to populate .Range("E10") with a number based on another field so if wsSource.Range("B6")= "Quarterly in Arrears", .Range("B8"), Else .Range("B9") How do I do that? Thanks! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF using VBA
Need to use the actual numeric value of the percentage. Percentage is only
the method used to display data; not the actual value. Note that the message line enclosed in the double quotes might break into 2 lines in this post. When you copy it into the VBA editor, if the line is in red then you will need to edit the line to make it one continuous line. If .Range("C5") .Value 0.13 Then MsgBox "Please contact the ABM for the specific extended net list price per part number." End If -- Regards, OssieMac "confused" wrote: Thank you -- what if I want to add a message to another section -- it's saying if Cell C5 has an amount greater than 13% then show this message at the bottom of the page. In If .Range("C5") = .Value "13%" Then With target "Message:Please contact the ABM for the specific extended net list price per part number." Else "" End If "OssieMac" wrote: I am not sure what values you want where but the following is an example of the If/Then/Else and you can substitue the ranges you require. If wsSource.Range("B6") = "Quarterly in Arrears" Then .Range("B8") = wsSource.Range("B5") Else .Range("B9") = wsSource.Range("B6") End If -- Regards, OssieMac "confused" wrote: I was wondering if you could help me with a little vba .. I have some code that populates a summary page .. I am needed to change this part where it's populating the below code under quantity .Range("E10") = wsSource.Range("B5") Somehow I need it to populate .Range("E10") with a number based on another field so if wsSource.Range("B6")= "Quarterly in Arrears", .Range("B8"), Else .Range("B9") How do I do that? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|