![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Mike
Posts: 796
|
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 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
Should be lastrow = Cells.SpecialCells(xlCellTypeLastCell).Row |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Mike
Posts: 796
|
BINGO. That worked.
Thanks very much. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|