Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Returning cursor to previous position

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Efto - 02 Mar 2006 12:29 GMT
Is there a way to return cursor to previous position after running a macro? I
will need to execute the macro but without changing the position of the
cursor.
Helmut Weber - 02 Mar 2006 15:29 GMT
Hi Efto,

basically like this:

Remember where the cursor is,
execute your macro, and go back.

Sub test0098()
Dim rTmp As Range
Set rTmp = Selection.Range
' execute code here or in another macro
rTmp.Select
End Sub

Which doesn't work,
if the original range isn't there anymore, of course.

Or if your code is in the same macro,
and does change rTmp.

Signature

Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"

Efto - 09 Mar 2006 12:16 GMT
Hi Helmut,

Thank you for your help!

> Hi Efto,
>
[quoted text clipped - 15 lines]
> Or if your code is in the same macro,
> and does change rTmp.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.