Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Is there an If Or Then statement?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bramnizzle@gmail.com - 27 Nov 2007 04:00 GMT
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
carlo - 27 Nov 2007 04:14 GMT
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, bramniz...@gmail.com wrote:
> I'm trying to make this work but I get a Type Mismatch error.  Any
> clues?
[quoted text clipped - 6 lines]
> Range("D11") = lAmount
> End If
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.