+ Reply to Thread
Results 1 to 9 of 9

value of i in a for next loop (even/uneven)

  1. #1
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201

    value of i in a for next loop (even/uneven)

    Hi all

    In my procedure I have a for ... next loop with "For i = 1 to Number"
    How can I determine the value of i during this loop.
    Whenever i is uneven some cell have to change color, if i is even cells remain unchanged.

    I have most of the code figured out, except for this part

    Who can help me?

    Thanks in advance
    Hein
    Last edited by Hein; 01-05-2009 at 07:00 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Hi Hein,
    I suppose that by "uneven" ( oneven) you mean "odd"?

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try posting your code for better help, However try this
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201
    I think this will work
    Thank you Roy!!
    Hein

    PS
    Arthur:
    I did indeed mean odd, sorry for my bad English

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by Hein View Post
    I think this will work
    Thank you Roy!!
    Hein

    PS
    Arthur:
    I did indeed mean odd, sorry for my bad English
    If it works please let us know by marking the thread solved & rating the answer(s)

    No problems with your english

    Without knowing what you are doing, you might be able to change the colours with Conditional Formatting

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    If you are only interested in your loop to colour every 2nd cell another option
    is to use Step of 2 with the For command

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If Mudraker is right then Chip Pearson shows hhow to achieve this

  8. #8
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201
    Thanks all for your help

    I have set the post to solved, but can't find how to rate it
    How can I do this?


    Hein

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Select the answer and click on the small icon on the top right that looks like a set scales

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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