Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 590
Default How can I move the cell pointer down one row in a macro command?

I am trying to find the macro command that automatically move the cell
pointer down one row. Exampl: for the end-up command you would write:
Selection.End(xlUp).Select .... What would it be to just move down One
cell????
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I move the cell pointer down one row in a macro command?


ActiveCell.Offset(1, 0).Range("A1").Select


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=570975

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How can I move the cell pointer down one row in a macro command?

Or just
activecell.offset(1,0).select



Chuckles123 wrote:

ActiveCell.Offset(1, 0).Range("A1").Select

--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=570975


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 590
Default How can I move the cell pointer down one row in a macro comman



Thank You for the info.. It works pretty good
  #5   Report Post  
Posted to microsoft.public.excel.programming
GM GM is offline
external usenet poster
 
Posts: 23
Default How can I move the cell pointer down one row in a macro comman

What about a sheet that has filtered rows?
With the keyboard I just hit "Down".

this code works if all the rows are displayed.
activecell.offset(1,0).select

What can I do to move across rows in a filtered sheet?
I need to move only across the displayed rows.

Thanks.
GM.



"Dave Peterson" wrote:

Or just
activecell.offset(1,0).select



Chuckles123 wrote:

ActiveCell.Offset(1, 0).Range("A1").Select

--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=570975


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How can I move the cell pointer down one row in a macro comman

One way is to just check after you move.

do
activecell.offset(1,0).select
if activecell.entirerow.hidden = false then
exit do
end if
loop

=====
It's not usually necessary to select a cell to work with it. If I wanted to
loop through each of the cells/rows in a filtered range, I could do something
like:

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRngV As Range

With Worksheets("sheet1")
Set myRngV = Nothing
On Error Resume Next
With .AutoFilter.Range.Columns(1)
Set myRngV = .Resize(.Rows.Count - 1, 1).Offset(1, 0) _
.Cells.SpecialCells(xlCellTypeVisible)
End With
On Error GoTo 0

If myRngV Is Nothing Then
MsgBox "no visible cells in autofilter range"
End If
End With

For Each myCell In myRngV.Cells
'do anything I want to the cell/row.
MsgBox myCell.Address(0, 0)
Next myCell

End Sub

GM wrote:

What about a sheet that has filtered rows?
With the keyboard I just hit "Down".

this code works if all the rows are displayed.
activecell.offset(1,0).select

What can I do to move across rows in a filtered sheet?
I need to move only across the displayed rows.

Thanks.
GM.

"Dave Peterson" wrote:

Or just
activecell.offset(1,0).select



Chuckles123 wrote:

ActiveCell.Offset(1, 0).Range("A1").Select

--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=570975


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 590
Default How can I move the cell pointer down one row in a macro comman



Thanks for the Info.......
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
MOVE POINTER WON'T APPEAR ANYMORE TAMMY Excel Discussion (Misc queries) 2 March 26th 09 02:26 PM
how do I use the arrow keys to move the cell pointer? I have excel Move the cell pointer using arrow keys Excel Discussion (Misc queries) 1 August 20th 08 07:07 PM
VISUAL BASIC COMMAND TO MOVE CURSER DOWN ONE CELL Moving Problem! Excel Worksheet Functions 2 December 19th 06 08:00 AM
move mouse pointer to a default button(Enter) in messagebox x taol Excel Programming 1 March 31st 06 01:17 PM
how to move the pointer in a filtered selection Alvaro Silva Excel Programming 3 August 5th 05 03:42 PM


All times are GMT +1. The time now is 11:59 PM.

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

About Us

"It's about Microsoft Excel"