+ Reply to Thread
Results 1 to 4 of 4

Need the proper syntax to use Case/Select Case in vba properly.

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    13

    Need the proper syntax to use Case/Select Case in vba properly.

    I want to create a column that identifies the type of laptop in each row. There are four possibilities (standard, lightweight, test standard and test lightweight). I'm a beginner at macros/vba but want to learn how to use the Select Case feature in my script. I'm missing something obvious as the macro thinks everything is the same :-( Please see attached file with macro.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need the proper syntax to use Case/Select Case in vba properly.

    Try this, but note this isn't the usual way to use Select Case.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-24-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Need the proper syntax to use Case/Select Case in vba properly.

    That simple change did make it work perfectly thanks.

    I'll continue reading on the proper use of Select Case since I've had little exposure to it so far. I thought it was used similar to an IF statement except Select Case allows for multiple situations/conditions.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need the proper syntax to use Case/Select Case in vba properly.

    Don't know if it will help but have a look here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1