+ Reply to Thread
Results 1 to 4 of 4

Nasty IF Statement

  1. #1
    bodhisatvaofboogie
    Guest

    Nasty IF Statement

    Okay :

    On Error Resume Next
    Columns("A").SpecialCells(xlBlanks).Offset(-1).Select
    On Error GoTo 0

    This works up to here.....this is what I'm trying to accomplish after I have
    that selected.....

    If the value of the cell is equal to 16 then insert 14 rows, if the value is
    15 then insert 15 rows, if the value 14 then insert 16 rows, if the value is
    13 then insert 17 rows...etc etc on down the list. It's a pretty nasty
    sounding IF statement, how do I get something like that to work and what
    would the code look like??? THANKS!!!

    THANKS!!!!!

  2. #2
    Barb Reinhardt
    Guest

    RE: Nasty IF Statement

    I can't help with the code, but it looks like you need to insert 30 - (value
    of cell) rows. Is this correct?

    "bodhisatvaofboogie" wrote:

    > Okay :
    >
    > On Error Resume Next
    > Columns("A").SpecialCells(xlBlanks).Offset(-1).Select
    > On Error GoTo 0
    >
    > This works up to here.....this is what I'm trying to accomplish after I have
    > that selected.....
    >
    > If the value of the cell is equal to 16 then insert 14 rows, if the value is
    > 15 then insert 15 rows, if the value 14 then insert 16 rows, if the value is
    > 13 then insert 17 rows...etc etc on down the list. It's a pretty nasty
    > sounding IF statement, how do I get something like that to work and what
    > would the code look like??? THANKS!!!
    >
    > THANKS!!!!!


  3. #3
    JMB
    Guest

    RE: Nasty IF Statement

    Is this along the lines of what you're thinking?

    Range(ActiveCell, ActiveCell(30 - _
    ActiveCell.Value, 1)).EntireRow.Insert


    "Barb Reinhardt" wrote:

    > I can't help with the code, but it looks like you need to insert 30 - (value
    > of cell) rows. Is this correct?
    >
    > "bodhisatvaofboogie" wrote:
    >
    > > Okay :
    > >
    > > On Error Resume Next
    > > Columns("A").SpecialCells(xlBlanks).Offset(-1).Select
    > > On Error GoTo 0
    > >
    > > This works up to here.....this is what I'm trying to accomplish after I have
    > > that selected.....
    > >
    > > If the value of the cell is equal to 16 then insert 14 rows, if the value is
    > > 15 then insert 15 rows, if the value 14 then insert 16 rows, if the value is
    > > 13 then insert 17 rows...etc etc on down the list. It's a pretty nasty
    > > sounding IF statement, how do I get something like that to work and what
    > > would the code look like??? THANKS!!!
    > >
    > > THANKS!!!!!


  4. #4
    Barb Reinhardt
    Guest

    RE: Nasty IF Statement

    See JMBs response.

    "bodhisatvaofboogie" wrote:

    > Okay :
    >
    > On Error Resume Next
    > Columns("A").SpecialCells(xlBlanks).Offset(-1).Select
    > On Error GoTo 0
    >
    > This works up to here.....this is what I'm trying to accomplish after I have
    > that selected.....
    >
    > If the value of the cell is equal to 16 then insert 14 rows, if the value is
    > 15 then insert 15 rows, if the value 14 then insert 16 rows, if the value is
    > 13 then insert 17 rows...etc etc on down the list. It's a pretty nasty
    > sounding IF statement, how do I get something like that to work and what
    > would the code look like??? THANKS!!!
    >
    > THANKS!!!!!


+ 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