![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 04:00 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com