+ Reply to Thread
Results 1 to 5 of 5

Select Case using a Variable

  1. #1
    Registered User
    Join Date
    12-02-2013
    Location
    Leicester
    MS-Off Ver
    Excel 2010
    Posts
    83

    Select Case using a Variable

    Hi this should be a simple thing but having one of those days

    i and trying to get a selcte case to use a varible that can change

    I have set the Varible to link to a cell on on one of the worksheets but the selcte case does not pick it up

    i sm using

    Please Login or Register  to view this content.
    (note there are other cases but i cant give them a;ll out but once one works the rest can be changed)

    Or would it be better to do something like this

    Please Login or Register  to view this content.

    i have assigned my varible like this

    Please Login or Register  to view this content.
    Not sure if thats right Sheet18 is alos called allocation

  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: Select Case using a Variable

    Can we see the rest of the code, in particulare the Select part of the Select case?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-02-2013
    Location
    Leicester
    MS-Off Ver
    Excel 2010
    Posts
    83

    Re: Select Case using a Variable

    Please Login or Register  to view this content.

  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: Select Case using a Variable

    It would really help if you posted all the code and/or uploaded a sample workbook.

  5. #5
    Registered User
    Join Date
    12-02-2013
    Location
    Leicester
    MS-Off Ver
    Excel 2010
    Posts
    83

    Re: Select Case using a Variable

    Please Login or Register  to view this content.
    I need to it read from Sheet18 (allocation) Col L 1 onwards as these details may change from time to time otherwise it a case of changing the names in the case staement when we get new staff

    also

    how can i put this omewhere in my code so i can call it for each sheet i have 10 instead of coping it into each sheets code
    Last edited by Cupragsw; 02-03-2015 at 11:59 AM.

+ 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] VBA - Select case and date range with a variable
    By BrownBoy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2014, 06:48 PM
  2. Replies: 4
    Last Post: 05-06-2013, 11:06 AM
  3. How to change a variable using select case
    By ref in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2012, 11:59 AM
  4. Select case with public variable???
    By Kelso89 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-28-2011, 10:50 AM
  5. Variable Command Statment w/ Select Case
    By mpeplow in forum Excel General
    Replies: 1
    Last Post: 04-06-2007, 05:49 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