Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: NateO (From Yesterday)

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Mike
    Posts
    796
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Had a chance to try your suggestion with the following;

    Dim lastrow As Long, cell As Range
    Dim UsedRng As Range, UsedCell As Range

    lastrow = .Cells.SpecialCells(xlCellTypeLastCell).Row
    For Each cell In Range("m2:m" & lastrow)
    If cell.Offset(, -2).Value < 0 And cell.Value > 0 _
    Then cell = -cell.Value
    Next cell

    I'm getting a Debug error which states
    "Invalid or unqualified reference"
    at (.Cells) which follows lastrow = .Cells


    Any suggestions?

    Zac

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-10 04:58, Zac wrote:
    Had a chance to try your suggestion with the following;

    Dim lastrow As Long, cell As Range
    Dim UsedRng As Range, UsedCell As Range

    lastrow = .Cells.SpecialCells(xlCellTypeLastCell).Row
    For Each cell In Range("m2:m" & lastrow)
    If cell.Offset(, -2).Value < 0 And cell.Value > 0 _
    Then cell = -cell.Value
    Next cell

    I'm getting a Debug error which states
    "Invalid or unqualified reference"
    at (.Cells) which follows lastrow = .Cells


    Any suggestions?

    Zac
    lastrow = .Cells.SpecialCells(xlCellTypeLastCell).Row


    Should be
    lastrow = Cells.SpecialCells(xlCellTypeLastCell).Row



    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Mike
    Posts
    796
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    BINGO. That worked.

    Thanks very much.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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