What is wrong with my select case statement

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
1,121
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"
 

Kenneth Hobson

Well-known Member
Joined
Feb 6, 2007
Messages
3,092
Set is for objects. A string is not an object.
Code:
Dim city As String
        '[COLOR="#FF0000"]Set[/COLOR] city = ThisWorkbook.Worksheets("Start_here").Range("H9").Value
        Select Case  ThisWorkbook.Worksheets("Start_here").Range("H9").Value
 

Forum statistics

Threads
1,085,099
Messages
5,381,720
Members
401,752
Latest member
cbrooke1313

Some videos you may like

This Week's Hot Topics

Top