+ Reply to Thread
Results 1 to 4 of 4

How to change a variable using select case

  1. #1
    Registered User
    Join Date
    02-03-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    23

    How to change a variable using select case

    I have the code shown below and i want to shorten it through a loop.
    Please Login or Register  to view this content.
    I wrote this, but didn't work. It seems that j and k increase their value every time i run the select case method and not when case 0 to 9 are been called.

    Please Login or Register  to view this content.
    Last edited by ref; 02-16-2012 at 12:02 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to change a variable using select case

    ref,

    I'm not sure what the j and k are supposed to be doing. From what I can tell, they're not needed to begin with. Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    02-03-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: How to change a variable using select case

    Quote Originally Posted by tigeravatar View Post
    ref,

    I'm not sure what the j and k are supposed to be doing. From what I can tell, they're not needed to begin with. Give this a try:
    Please Login or Register  to view this content.
    Thx tigeravatar, it worked for what i want it.

    In the code i had, j and k supposed to increase their value by one with case jumping from 1 to 2 proportionally. Seems that you used ComboBox5.ListIndex as value.
    Only way this can be done is by using listindex as value?

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to change a variable using select case

    I don't know about it being the only way, but its probably the most straightforward

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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