Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default cursor position

How do I code the Macro to determine the current position of the cursor? Say
whether it's at A5 or at A10. For example, I instruct user to paste a block
of data that can be at least 2 row big at A1. And than start the macro. The
macro will position the cursor to A1 and than simulate the END key and the
down arrow key to go to the end of the data block. I need to know the
position of the cursor after the END key and the Down Arrow is pressed to
further code the rest of the macro. I don't know what function or statement
to use. Can anybody help? Thanks.

The simple END key and Down Arrow key coding will be something like this:
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
'the rest of the code will be based on the position of the cursor where
it is at. i.e. A1:??

Fan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default cursor position

Activecell.Address

--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



"Fan Fan" wrote in message
...
How do I code the Macro to determine the current position of the cursor?

Say
whether it's at A5 or at A10. For example, I instruct user to paste a

block
of data that can be at least 2 row big at A1. And than start the macro.

The
macro will position the cursor to A1 and than simulate the END key and

the
down arrow key to go to the end of the data block. I need to know the
position of the cursor after the END key and the Down Arrow is pressed to
further code the rest of the macro. I don't know what function or

statement
to use. Can anybody help? Thanks.

The simple END key and Down Arrow key coding will be something like this:
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
'the rest of the code will be based on the position of the cursor

where
it is at. i.e. A1:??

Fan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default cursor position

Hi Andy,

Thank you very much for your help. Your answer is what I am looking for.

Fan

"Andy Wiggins" <xx wrote in message
...
Activecell.Address

--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



"Fan Fan" wrote in message
...
How do I code the Macro to determine the current position of the cursor?

Say
whether it's at A5 or at A10. For example, I instruct user to paste a

block
of data that can be at least 2 row big at A1. And than start the macro.

The
macro will position the cursor to A1 and than simulate the END key and

the
down arrow key to go to the end of the data block. I need to know the
position of the cursor after the END key and the Down Arrow is pressed to
further code the rest of the macro. I don't know what function or

statement
to use. Can anybody help? Thanks.

The simple END key and Down Arrow key coding will be something like this:
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
'the rest of the code will be based on the position of the cursor

where
it is at. i.e. A1:??

Fan






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cursor position

you also might look at

Range("A1").CurrentRegion.Select

--
Regards,
Tom Ogilvy



"Fan Fan" wrote in message
...
Hi Andy,

Thank you very much for your help. Your answer is what I am looking for.

Fan

"Andy Wiggins" <xx wrote in message
...
Activecell.Address

--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



"Fan Fan" wrote in message
...
How do I code the Macro to determine the current position of the

cursor?
Say
whether it's at A5 or at A10. For example, I instruct user to paste a

block
of data that can be at least 2 row big at A1. And than start the macro.

The
macro will position the cursor to A1 and than simulate the END key and

the
down arrow key to go to the end of the data block. I need to know the
position of the cursor after the END key and the Down Arrow is pressed

to
further code the rest of the macro. I don't know what function or

statement
to use. Can anybody help? Thanks.

The simple END key and Down Arrow key coding will be something like

this:
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
'the rest of the code will be based on the position of the cursor

where
it is at. i.e. A1:??

Fan








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
cursor position MarkT Excel Discussion (Misc queries) 5 February 7th 07 01:25 PM
Cursor position saziz Excel Discussion (Misc queries) 2 August 9th 05 08:19 PM
Cursor position? Marc Excel Discussion (Misc queries) 1 March 27th 05 07:09 PM
Position Cursor to A1 Dennis Damsgaard Excel Programming 3 June 8th 04 10:30 PM
cursor position NTL Excel Programming 1 January 18th 04 08:23 PM


All times are GMT +1. The time now is 03:01 AM.

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"