Thread: IF using VBA
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default 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!