Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wouldn't say that your procedure can't be used, its just that it couldn't
be used as written. We have been providing assistance based on knowing that the value is "65", you can use any mathematical comparison or review of the data that will meet your skip boundary condition. If it is desired to skip the cell to the right if it is less than the current cell then the if statement could be as below: if activecell.offset(0,1).value < activecell.value then activecell.offset(0,2).select end if GB "Joanne" wrote: Thank you for the help guys - I've learned something new and my proc is not usable Joanne Chip Pearson wrote: Joanne, You have declared the variable "cell" and you attempt to use it in the line "If cell.Value = 65", but you have not assigned the variable "cell" to refer to any specific cell. In your code, "cell" can be assign to refer to any cell, but if you don't do assignment with a "Set" statement, "cell" has the special value "Nothing" which means that it doesn't refer to any cell at all. You can remedy this with code like the following: Dim cell As Range Set cell = ActiveCell '<<< makes "cell" refer to ActiveCell If cell..Value = 65 Then ' rest of the code Or, you can omit the "cell" value entirely: Public Sub SkipLaborRate() If ActiveCell.Value = 65 Then ActiveCell.Offset(0, 2).Select End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
move cursor on one sheet moves cursor on all sheets | Excel Discussion (Misc queries) | |||
Move cursor to next row | Excel Discussion (Misc queries) | |||
auto move cursor after entering number in excel | Excel Worksheet Functions | |||
Cursor auto move from one cell to another | Excel Programming | |||
HOW TO MOVE CURSOR | Excel Programming |