Results 1 to 3 of 3

Thread: What is wrong with my select case statement
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Aug 2018
    Location
    NSW, Australia
    Posts
    984
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default What is wrong with my select case statement

    This is the start of my select case statement and it has an error and I can't figure out why, can someone help me please?

    Code:
    Dim printWorksheet As Worksheet, logoShape As Shape, tempImageFile As String
    Dim city As String
            Set city = ThisWorkbook.Worksheets("Start_here").Range("H9").Value
            Select Case city
                case is "town1"

  2. #2
    Board Regular
    Join Date
    Aug 2018
    Location
    NSW, Australia
    Posts
    984
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is wrong with my select case statement

    Never mind, I got it working.

  3. #3
    Board Regular Kenneth Hobson's Avatar
    Join Date
    Feb 2007
    Location
    Tecumseh, OK
    Posts
    3,079
    Post Thanks / Like
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is wrong with my select case statement

    Set is for objects. A string is not an object.
    Code:
    Dim city As String
            'Set city = ThisWorkbook.Worksheets("Start_here").Range("H9").Value
            Select Case  ThisWorkbook.Worksheets("Start_here").Range("H9").Value

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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