[mso] Re: Word & nested IIF

  • From: "David Smart" <smartware@xxxxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Thu, 11 May 2006 00:31:15 +1000

This from the Excel VBE, but word should be the same

Sub a()
  Dim Abc As String
  Abc = "Fred"
  Dim City As String
  Select Case Abc
    Case "Joe"
      City = "Sydney"
    Case "Fred", "Jim"
      City = "Melbourne"
    Case Else
      MsgBox "Haven't heard of this guy"
  End Select
End Sub

The Select Case is a nice easy way to select between similar things without 
a chain of nested IF's.

Regards, Dave S
----- Original Message ----- 
From: "GLENDA WELLS" <gwells58@xxxxxxx>
To: <mso@xxxxxxxxxxxxx>
Sent: Wednesday, May 10, 2006 11:38 PM
Subject: [mso] Re: Word & nested IIF


> do you have an example David?  I looked up CASE in the help and got a 
> bunch
> of references to Japanese text and CD Jewel Case design.  On the web I got 
> a
> lot ov VB that wasn't very clear to me.
>
>
>>From: "David Smart" <smartware@xxxxxxxxxxxxxxx>
>>Reply-To: mso@xxxxxxxxxxxxx
>>To: <mso@xxxxxxxxxxxxx>
>>Subject: [mso] Re: Word & nested IIF
>>Date: Wed, 10 May 2006 20:31:16 +1000
>>
>>I'm coming in very late on this thread, but ...
>>
>>The other alternative to nested IF's is select case.  If you are wanting 
>>to
>>act on multiple values that can be in a variable, the old case statement 
>>is
>>often the way to go.
>>
>>Regards, Dave S
>>----- Original Message -----
>>From: "GLENDA WELLS" <gwells58@xxxxxxx>
>>To: <mso@xxxxxxxxxxxxx>
>>Sent: Wednesday, May 10, 2006 7:56 AM
>>Subject: [mso] Word & nested IIF
>>
>>
>> > Hi All.
>> >
>> > I had requested suggestions on whether or not to use nested IF in Word
>>to
>> > tell a merge document what text to input based on a value in the merge
>> > file.
>> >
>> > Someone here suggested VLOOKUP which I played around with but could not
>> > get
>> > to work with my scenario.
>> >
>> > Anyway, the nested IF is working although cumbersome to set up.
>> >
>> > Sorry I don't have the reference email (MSN deletes everything after 5
>> > days)
>> > but I wanted to let y'all know I made a choice.
>> >
>> > Thanks. /g
>> >
>> > _________________________________________________________________
>> > FREE pop-up blocking with the new MSN Toolbar - get it now!
>> > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>> >
>> > *************************************************************
>> > You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
>>or
>> > MicrosoftOffice@xxxxxxxxxxxxxxxx
>> >
>> > To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>> >
>> > To Unsubscribe from this group, visit the group's homepage and use the
>> > dropdown menu at the top.  This will allow you to unsubscribe your 
>> > email
>> > address or change your email settings to digest or vacation (no mail).
>> > //www.freelists.org/webpage/mso
>> >
>> > To be able to use the files section for sharing files with the group,
>>send
>> > a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
>> > invitation with instructions.  Once you are a member of the files 
>> > group,
>> > you can go here to upload/download files:
>> > http://www.smartgroups.com/vault/msofiles
>> >
>> > If you are using Outlook and you see a lot of unnecessary code in your
>> > email messages, read these instructions that explain why and how to fix
>> > it:
>> > http://personal-computer-tutor.com/abc3/v28/greg28.htm
>> > *************************************************************
>> >
>>
>>*************************************************************
>>You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
>>MicrosoftOffice@xxxxxxxxxxxxxxxx
>>
>>To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>>
>>To Unsubscribe from this group, visit the group's homepage and use the
>>dropdown menu at the top.  This will allow you to unsubscribe your email
>>address or change your email settings to digest or vacation (no mail).
>>//www.freelists.org/webpage/mso
>>
>>To be able to use the files section for sharing files with the group, send
>>a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
>>invitation with instructions.  Once you are a member of the files group,
>>you can go here to upload/download files:
>>http://www.smartgroups.com/vault/msofiles
>>
>>If you are using Outlook and you see a lot of unnecessary code in your
>>email messages, read these instructions that explain why and how to fix 
>>it:
>>http://personal-computer-tutor.com/abc3/v28/greg28.htm
>>*************************************************************
>
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from McAfee®
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
> *************************************************************
> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
> MicrosoftOffice@xxxxxxxxxxxxxxxx
>
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>
> To Unsubscribe from this group, visit the group's homepage and use the 
> dropdown menu at the top.  This will allow you to unsubscribe your email 
> address or change your email settings to digest or vacation (no mail).
> //www.freelists.org/webpage/mso
>
> To be able to use the files section for sharing files with the group, send 
> a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an 
> invitation with instructions.  Once you are a member of the files group, 
> you can go here to upload/download files:
> http://www.smartgroups.com/vault/msofiles
>
> If you are using Outlook and you see a lot of unnecessary code in your 
> email messages, read these instructions that explain why and how to fix 
> it:
> http://personal-computer-tutor.com/abc3/v28/greg28.htm
> *************************************************************
> 

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts: