Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to make this work but I get a Type Mismatch error. Any
clues? If strFrequency = "ea pay" Or "each pay" Or "Bi Weekly" Or "Bi-Weekly" Or "BI WEEKLY" Or "BI-WEEKLY" Or "bi weekly" Or "bi-weekly" Or "EA PAY" Or "EACH PAY" Or "Ea Pay" Or "Each Pay" Then Range("D11") = lAmount * 2 Else Range("D11") = lAmount End If |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
2 things
1.) you have to tell excel what you compare everytime 2.) you can use LCase to change the case of all the Letters in strFrequency to lower case, so you won't have any problems with case sensitivity. If LCase(strFrequency) = "ea pay" Or _ LCase(strFrequency) = "each pay" Or _ LCase(strFrequency) = "bi weekly" Or _ LCase(strFrequency) = "bi-weekly" Then Range("D11") = lAmount * 2 Else Range("D11") = lAmount End If I put the _ after the lines in order to avoid word wrap. If you want it one whole line, just delete the _ and put it back together. hth Carlo On Nov 27, 1:00 pm, wrote: I'm trying to make this work but I get a Type Mismatch error. Any clues? If strFrequency = "ea pay" Or "each pay" Or "Bi Weekly" Or "Bi-Weekly" Or "BI WEEKLY" Or "BI-WEEKLY" Or "bi weekly" Or "bi-weekly" Or "EA PAY" Or "EACH PAY" Or "Ea Pay" Or "Each Pay" Then Range("D11") = lAmount * 2 Else Range("D11") = lAmount End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF statement inside a SUMIF statement.... or alternative method | Excel Worksheet Functions | |||
Reconcile Bank statement & Credit card statement & accounting data | Excel Worksheet Functions | |||
Embedding an OR statement in an IF statement efficiently | Excel Discussion (Misc queries) | |||
Using an IF statement, or VLOOKUP statement | Excel Programming | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions |