Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sendkeys and wait variant

I'm running a macro with a sendkeys statement, followed by a past
command. However, I can't seem to get the wait variant to work? Th
paste is running before the sendkeys, and for the life of me I can'
figure this one out. Here's a snipit:
You can see where I've tried to run the wait seperate, but it run
BEFORE the sendkeys also.

Application.CutCopyMode = False
Selection.Cut
Range("D5").Select
Application.SendKeys "{END}{DOWN}{DOWN}", True

'Application.Wait (Now + TimeValue("0:00:02"))
Application.Run "PASTE"

Call me stupid, but I'm stuck

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sendkeys and wait variant

Sub Tester2()
Selection.Cut Destination:=Range("D5").End(xldown)(2)
End Sub

--
Regards,
Tom Ogilvy


"accountingboy " wrote in
message ...
I'm running a macro with a sendkeys statement, followed by a paste
command. However, I can't seem to get the wait variant to work? The
paste is running before the sendkeys, and for the life of me I can't
figure this one out. Here's a snipit:
You can see where I've tried to run the wait seperate, but it runs
BEFORE the sendkeys also.

Application.CutCopyMode = False
Selection.Cut
Range("D5").Select
Application.SendKeys "{END}{DOWN}{DOWN}", True

'Application.Wait (Now + TimeValue("0:00:02"))
Application.Run "PASTE"

Call me stupid, but I'm stuck.


---
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
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Should I Wait? Chaplain Doug Excel Discussion (Misc queries) 0 February 6th 07 04:58 PM
VBA Code to wait 50-150 mS Hotbird[_2_] Excel Programming 2 December 31st 03 09:15 PM
wait Eddie[_4_] Excel Programming 3 November 15th 03 03:37 PM
Problem with WAIT Mike[_46_] Excel Programming 0 August 31st 03 01:27 AM


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

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"