Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default paste is too fast

I have a problem where my paste command is getting done before my
instruction to move to the next cell. Causing my value to get put into
my first box instead of the second, then it moves to the next box.

It's supposed to (select sheet "0", select a cell specified cell, move
down "MyValue". Then go to the "Entry" sheet, copy a specified cell,
return to sheet "0" and paste the value into the newly selected cell)

------ Here's the code ---

Public MyValue As Integer
----------------------------------

Sub Macro2()

Dim Message, Title, Default, MyValue
Message = "Enter the Day you are working on." ' Set prompt.
Title = "Current Day" ' Set title.
Default = "" ' Set default.


MyValue = InputBox(Message, Title, Default)
Sheets("0").Select
Application.Goto Reference:="R4C22"
ActiveCell.Select
Application.SendKeys "{DOWN " + MyValue + "}"

Sheets("Entry").Select
Range("G89").Select
Selection.Copy

Sheets("0").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
--------------------------------

Any help will be greatly appreaciated.
Thanks,
Allen (WinXP/ExcelXP/VB6.3)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default paste is too fast

It's best to avoid using SendKeys. The following code uses the Offset
property to paste the data the specified number of rows below the
starting cell on Sheet0:

MyValue = InputBox(Message, Title, Default)

Sheets("Entry").Select
Range("G89").Copy
Sheets("0").Select
Range("V4").Offset(MyValue, 0).PasteSpecial _
Paste:=xlPasteValues


alien___alien wrote:
I have a problem where my paste command is getting done before my
instruction to move to the next cell. Causing my value to get put into
my first box instead of the second, then it moves to the next box.

It's supposed to (select sheet "0", select a cell specified cell, move
down "MyValue". Then go to the "Entry" sheet, copy a specified cell,
return to sheet "0" and paste the value into the newly selected cell)

------ Here's the code ---

Public MyValue As Integer
----------------------------------

Sub Macro2()

Dim Message, Title, Default, MyValue
Message = "Enter the Day you are working on." ' Set prompt.
Title = "Current Day" ' Set title.
Default = "" ' Set default.


MyValue = InputBox(Message, Title, Default)
Sheets("0").Select
Application.Goto Reference:="R4C22"
ActiveCell.Select
Application.SendKeys "{DOWN " + MyValue + "}"

Sheets("Entry").Select
Range("G89").Select
Selection.Copy

Sheets("0").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
--------------------------------

Any help will be greatly appreaciated.
Thanks,
Allen (WinXP/ExcelXP/VB6.3)



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default paste is too fast

How about this? No selecting. No copying. No pasting.

sub getrngvalue()
MyValue = InputBox(Message, Title, Default)
sheets("O").range("v4").offset(myvalue)=Sheets("En try").Range("G89")
end sub

"alien___alien" wrote in message
...
I have a problem where my paste command is getting done before my
instruction to move to the next cell. Causing my value to get put into
my first box instead of the second, then it moves to the next box.

It's supposed to (select sheet "0", select a cell specified cell, move
down "MyValue". Then go to the "Entry" sheet, copy a specified cell,
return to sheet "0" and paste the value into the newly selected cell)

------ Here's the code ---

Public MyValue As Integer
----------------------------------

Sub Macro2()

Dim Message, Title, Default, MyValue
Message = "Enter the Day you are working on." ' Set prompt.
Title = "Current Day" ' Set title.
Default = "" ' Set default.


MyValue = InputBox(Message, Title, Default)
Sheets("0").Select
Application.Goto Reference:="R4C22"
ActiveCell.Select
Application.SendKeys "{DOWN " + MyValue + "}"

Sheets("Entry").Select
Range("G89").Select
Selection.Copy

Sheets("0").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
--------------------------------

Any help will be greatly appreaciated.
Thanks,
Allen (WinXP/ExcelXP/VB6.3)



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
You Need Fast Money ????? You Need Fast Money??? Links and Linking in Excel 0 December 16th 08 11:34 PM
Fast Filter Abdul Shakeel Excel Discussion (Misc queries) 2 March 31st 08 12:32 PM
Please help fast - creating pop ups mward77095 Excel Discussion (Misc queries) 3 May 8th 06 08:55 PM
Need help fast! [email protected] Excel Discussion (Misc queries) 2 October 1st 05 04:10 AM
Need help fast! Thanks! spectator Excel Discussion (Misc queries) 4 July 27th 05 07:01 AM


All times are GMT +1. The time now is 10:15 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"