Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem selecting only one cell at a time in excel 07 rot Excel Discussion (Misc queries) 0 July 2nd 08 08:40 AM
Special selecting problem Ingmar Heinrich Excel Discussion (Misc queries) 4 June 19th 07 06:01 PM
problem initially selecting a cell labrat64 Excel Discussion (Misc queries) 2 April 18th 07 08:54 PM
Problem with selecting cells FiluDlidu Excel Discussion (Misc queries) 2 November 28th 06 10:10 PM
problem with selecting something solo_razor[_2_] Excel Programming 0 September 15th 03 12:22 PM


All times are GMT +1. The time now is 03:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"