Results 1 to 4 of 4
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Select Case Odd (XP/SP2)

    I am going through a long spreadsheet and need to do copy the odd rows one place and the even another. So far, I have <pre>For B = 2 To BotRow
    Select Case B
    Case IsEven
    -- stuff -- </pre>

    but I seem to have the syntax wrong. Help!

    Thanx,
    Alan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select Case Odd (XP/SP2)

    IsEven is not valid. Try this:

    For B = 2 To BotRow
    If B Mod 2 = 0 Then
    ' code for even rows goes here
    Else
    ' code for odd rows goes here
    End If
    Next B

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select Case Odd (XP/SP2)

    You could do something like this:

    <pre> For B = 2 To BotRow
    Select Case B Mod 2
    Case 0
    'Do even stuff here
    Case 1
    'Do odd stuff here
    End Select
    Next B
    </pre>

    Legare Coleman

  4. #4
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: Select Case Odd (XP/SP2)

    Perfect! <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>
    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •