Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    condition... on 2 column (2000 sr 1)

    i have this wbook and sheet, my prob:
    If the value in the last cell of column K is the same of the last cell in the column L the exit sub else call my macro...
    Naturally dont know the number of cell filled in effect make the condition for max extention of cells (65536 cells...)

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

    Re: condition... on 2 column (2000 sr 1)

    Will the last cell in column K always be in the same row as the last cell in column L (as in the workbook you attached), or can they be in different rows?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: condition... on 2 column (2000 sr 1)

    Yes, the last cell of column K and colmun L have always the same value...
    column K 24/12/2004 and column L 24/12/2004
    column K 14/12/2004 and column L 14/12/2004
    ....
    ecc...

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

    Re: condition... on 2 column (2000 sr 1)

    Use something like this:

    Sub SomethingOrOther()
    Dim oCell As Range
    Set oCell = Range("K65536").End(xlUp)
    If oCell.Value = oCell.Offset(0, 1).Value Then
    Exit Sub
    End If
    Call MyMacro
    End Sub

    oCell.Offset(0, 1) is the cell in the same row (row offset = 0) but in the next column (column offset = 1), i.e. the cell in column L.

Posting Permissions

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