+ Reply to Thread
Results 1 to 3 of 3

Case statement won't assign variables

  1. #1
    Registered User
    Join Date
    01-07-2023
    Location
    Johannesburg, South Afrca
    MS-Off Ver
    2019
    Posts
    6

    Question Case statement won't assign variables

    I have a case statement and I want to assign values to a set of two variables when a condition is met but both my variables are returning zero. can you please help me

    Please Login or Register  to view this content.
    Last edited by TyroneBigFoot; 01-12-2023 at 10:40 AM.

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,987

    Re: Case statement won't assign variables

    You don't need the reference to regExString in each case.

    So it should be Case "HA" not Case regExString = "HA"

  3. #3
    Registered User
    Join Date
    01-07-2023
    Location
    Johannesburg, South Afrca
    MS-Off Ver
    2019
    Posts
    6

    Re: Case statement won't assign variables

    Thank you, your a lifesaver

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to assign case to staff fairly
    By sssyyy2002 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-05-2020, 07:57 AM
  2. [SOLVED] Select Case with multiple lines in a case statement?
    By jGKpZ8a33sPrnqX8fam7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2017, 10:25 AM
  3. [SOLVED] i have an if then statement that works, how to make it work as a with or case statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2016, 03:34 PM
  4. VBA assign Variables
    By electriczen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2016, 09:27 PM
  5. [SOLVED] Assign values to case sensitive characters within string
    By tbsweet52 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-01-2015, 05:37 PM
  6. Using Array to define variables for Select Case Statement
    By B_B in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2013, 09:41 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

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