Results 1 to 5 of 5

Thread: [RESOLVED] Excel Gurus needed: Combine into one statement

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Long Island, NY.
    Posts
    353

    Resolved [RESOLVED] Excel Gurus needed: Combine into one statement

    I need to get these two together somehow, someway:
    Don't know how since they use different cell ranges. Please, please, help I really need to move past this. Thanks!
    VB Code:
    1. ' ----------first statement---------------
    2. For Each MyCell2 In Sheet1.Columns("A").Cells
    3. With MyCell2
    4.     If .Value = "" Then Exit For
    5.     If .Value = 574 _
    6.     Or .Value = 555 _
    7.     Or .Value = 510 Then
    8.         .Offset(0, 12).Value = .Offset(0, 8).Value * 1.1
    9.     End If
    10. End With
    11. Next MyCell2
    12. '-------------second statement-------------
    13. For Each MyCell3 In Sheet1.Columns("D").Cells
    14. With MyCell3
    15.     If .Value = "" Then Exit For
    16.     If .Value <> "OMI" Then
    17.         .Offset(0, 9).Value = .Offset(0, 5).Value * 1.4503
    18.     Else
    19.         .Offset(0, 9).Value = .Offset(0, 5).Value
    20.     End If
    21. End With
    22. Next MyCell3

  2. #2
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Excel Gurus needed: Combine into one statement

    I have no clue what you need to accomplish
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Long Island, NY.
    Posts
    353

    Re: Excel Gurus needed: Combine into one statement

    If cells in Column D don't equal "OMI" times value by 1.4503, but it the cells in Column A are 574, 555, or 510 then only times them by 1.1, else just keep the value from one cell and put it in another.

  4. #4
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Excel Gurus needed: Combine into one statement

    You may need to put loop2 inside your loop1 then. Make sense?
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Long Island, NY.
    Posts
    353

    Re: Excel Gurus needed: Combine into one statement

    I figured it out! Thanks!

Posting Permissions

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



Click Here to Expand Forum to Full Width