Can there be any macro or a trick where i can keep the cursor moving within the selected cells continously unless I manually interrupt the movement. Let's say in the attached file, i need to keep the cursor moving to E4,E5,E6,F4,F5,F6... loop...
Can this be done throgh any means without me actually keeping on pressing the key ?
Maybe it sounds silly, Reason i am asking this is the laptop logs off when i am into discussion with colleagues for a long time and i need to log on again and again to check the messages and mails.
I know we can change the time within which the laptop can log off when idle, but i don't have admin access to change that.
Thanks in advance
Shreeram
Keep the cursor moving
-
- 2StarLounger
- Posts: 181
- Joined: 19 Feb 2016, 16:54
- Location: Veraval, India
Keep the cursor moving
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78608
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Keep the cursor moving
I don't think it is a good idea to bypass the security measures imposed by your employer.
Best wishes,
Hans
Hans
-
- 2StarLounger
- Posts: 181
- Joined: 19 Feb 2016, 16:54
- Location: Veraval, India
Re: Keep the cursor moving
This does not amounts to bypass the security measures because I am not doing anything which is unauthorized. This is just for my administrative convenience.
-
- PlutoniumLounger
- Posts: 15647
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: Keep the cursor moving
Shreeram, I am inclined to agree with Hans, so explore the code here at your own risk.shreeram.maroo wrote: ↑23 Dec 2021, 06:10Can there be any macro or a trick where i can keep the cursor moving
Code: Select all
Option Explicit
' Can there be any macro or a trick where i can keep the cursor moving?
Const lngcSecondsInterval As Long = 5
Dim lngRow As Long
Dim lngCol As Long
Sub Macro2()
ActiveCell.Offset(lngRow, lngCol).Select
lngRow = -lngRow
lngCol = -lngCol
Application.OnTime Now + TimeSerial(0, 0, lngcSecondsInterval ), "Macro2"
End Sub
Sub Macro1()
lngRow = 1
lngCol = 1
Application.OnTime Now + TimeSerial(0, 0, lngcSecondsInterval ), "Macro2"
End Sub
This bit of code should get you started. It is not a complete solution to your stated problem. I developed it in Excel2003.
Try it by single-stepping through Macro1
Cheers
Chris
He who plants a seed, plants life.
-
- 2StarLounger
- Posts: 181
- Joined: 19 Feb 2016, 16:54
- Location: Veraval, India
Re: Keep the cursor moving
Hi Chris, this is working fine.. Thanks a lot for this.
-
- PlutoniumLounger
- Posts: 15647
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: Keep the cursor moving
Good to hear.
What happens if you eliminate "Macro1"? That is, what if I had supplied you with just "Macro2"?
Thanks
Chris
Code: Select all
Option Explicit
' Can there be any macro or a trick where i can keep the cursor moving?
Const lngcSecondsInterval As Long = 5
Dim lngRow As Long
Dim lngCol As Long
Sub Macro2()
ActiveCell.Offset(lngRow, lngCol).Select
lngRow = -lngRow
lngCol = -lngCol
Application.OnTime Now + TimeSerial(0, 0, lngcSecondsInterval), "Macro2"
End Sub
He who plants a seed, plants life.
-
- 4StarLounger
- Posts: 564
- Joined: 27 Jun 2021, 10:46
Re: Keep the cursor moving
>I am not doing anything which is unauthorized
If that is all security are worried about (which it won't be), then surely you can just ask your IT team to up the timeout for you
If that is all security are worried about (which it won't be), then surely you can just ask your IT team to up the timeout for you
-
- 5StarLounger
- Posts: 964
- Joined: 08 Nov 2012, 17:54
Re: Keep the cursor moving
Hmmm,
Slows things down but I think you should include DoEvents somewhere to allow a break.
Lisa
Slows things down but I think you should include DoEvents somewhere to allow a break.
Lisa
-
- Administrator
- Posts: 12628
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Keep the cursor moving
Probably not necessary as the sub only executes three lines and then ends.
Application.Ontime will allow events to occur before triggering the next iteration.
StuartR