Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default do I need ScrollArea and/or??

Hi and many thanks in advance!

I am using the following DLL:
Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVa
nVirtKey As Long) As Integer
Public Const KeyPressed As Integer = -32767
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


I have the following macro:
Sub Mov_OnTime()
On Error Resume Next
Do
Sleep 10
Select Case KeyPressed
Case GetAsyncKeyState(vbKeyEscape): End
Case GetAsyncKeyState(vbKeyDown): Move_Down
Case GetAsyncKeyState(vbKeyRight): Move_Right
Case GetAsyncKeyState(vbKeyUp): Mov_Change
Case GetAsyncKeyState(vbKeyLeft): Move_Left
Case Else: Move_Down
End Select
DoEvents
Range("A1").Select
Loop
End Sub

so when I press Esc my vba code ends
when I press, vbKeyDown) I call then Move_Down macro


Move_Down ,Move_Right ,Move_Left are made to move a specific Cell t
the right, left and or down
eg:

Sub Move_Right()
If MyBlock(1).Offset(0, 1).Locked = True Then end
MyBlock(1).Cut MyBlock(X).Offset(0, 1)
End Sub

my problem comes because when I press any of this keys without havin
the following "Range("A1").Select" code prior the loop end, see th
macro above
I scroll either down to the right and /or...

So I lose the view of my work after a few Move_Down and or Move_Right
calls

do I have to set up one ScrollArea to avoid this happening an
or?????????


Just let me kno

--
Message posted from http://www.ExcelForum.com

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
Limit Scrollarea exalan Excel Worksheet Functions 11 April 18th 08 10:32 AM
ScrollArea Kevin Excel Discussion (Misc queries) 2 August 23rd 07 11:21 PM
Scrollarea Doug Excel Discussion (Misc queries) 4 July 14th 06 03:43 PM
ScrollArea Property Won't Save Ron de Bruin Excel Programming 1 January 12th 04 11:03 PM
Activesheet.Scrollarea R. Todd Miller Excel Programming 1 October 3rd 03 04:42 PM


All times are GMT +1. The time now is 07:37 PM.

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

About Us

"It's about Microsoft Excel"