Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem selecting cell
rPassedRange consists of a row of cells.
I want to go through each cell, and when a value is found, I want to select down to find the next cell in that column that has a cell with a value. Can someone tell me what I am doing incorrectly? thanks For Each cell In rPassedRange If (cell.Value 0) Then cell.Select cell.Activate 'I get the address of the cell that I expect here. 'however it dopes not seem to be active MsgBox cell.Address Selection.End(xlDown).Select Set rNextCell = Selection 'here I am getting what ever cell is active on the worksheet rather than the next cell in the column with a value MsgBox rNextCell.Address End If Next |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem selecting cell
For Each cell In rPassedRange
If (cell.Value 0) Then cell.Select Set rNextCell = cell.End(xlDown) MsgBox cell.Address & " - " & rNextCell.Address End If Next -- Regards, Tom Ogilvy wrote in message ... rPassedRange consists of a row of cells. I want to go through each cell, and when a value is found, I want to select down to find the next cell in that column that has a cell with a value. Can someone tell me what I am doing incorrectly? thanks For Each cell In rPassedRange If (cell.Value 0) Then cell.Select cell.Activate 'I get the address of the cell that I expect here. 'however it dopes not seem to be active MsgBox cell.Address Selection.End(xlDown).Select Set rNextCell = Selection 'here I am getting what ever cell is active on the worksheet rather than the next cell in the column with a value MsgBox rNextCell.Address End If Next |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem selecting cell
Tom
Thanks, that works perfectly On Tue, 15 Jun 2004 22:05:29 -0400, "Tom Ogilvy" wrote: For Each cell In rPassedRange If (cell.Value 0) Then cell.Select Set rNextCell = cell.End(xlDown) MsgBox cell.Address & " - " & rNextCell.Address End If Next |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
problem selecting only one cell at a time in excel 07 | Excel Discussion (Misc queries) | |||
Special selecting problem | Excel Discussion (Misc queries) | |||
problem initially selecting a cell | Excel Discussion (Misc queries) | |||
Problem with selecting cells | Excel Discussion (Misc queries) | |||
problem with selecting something | Excel Programming |