PC Review


Reply
Thread Tools Rate Thread

how can a macro be paused for input and then resume executio

 
 
Khan
Guest
Posts: n/a
 
      13th Mar 2008
In the following macro in excel please answer the italic question
Range("A1").Select
Selection.End(xlDown).Select
Selection.End(xlDown).Select
ActiveCell.Range("A1:G1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Select
Dim x As String
x = InputBox("Put Value", "abc") ' How can the macro be paused here and
after input what
key will resume it ?
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Select

End Sub
Thanks for your help
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      13th Mar 2008
Hi,

Simply displaying an input box in this case pauses you macro waiting for
that input but it isn't immediatly obvious what you are trying to do.Have a
look at my version and post back with what you want to do with the input when
you have it. I've deleted some lines from your code that aren't necessary.

Sub stantially()
Range("A1:G1").Copy
Range("A2").Select
ActiveSheet.Paste
x = InputBox("Put Value", "abc")
ActiveCell.Offset(0, 1).Select
End Sub

Mike
"Khan" wrote:

> In the following macro in excel please answer the italic question
> Range("A1").Select
> Selection.End(xlDown).Select
> Selection.End(xlDown).Select
> ActiveCell.Range("A1:G1").Select
> Selection.Copy
> ActiveCell.Offset(1, 0).Range("A1").Select
> ActiveSheet.Paste
> ActiveCell.Select
> Dim x As String
> x = InputBox("Put Value", "abc") ' How can the macro be paused here and
> after input what
> key will resume it ?
> ActiveCell.Offset(0, 1).Range("A1").Select
> ActiveCell.Select
>
> End Sub
> Thanks for your help

 
Reply With Quote
 
Subodh Adarkar
Guest
Posts: n/a
 
      15th Mar 2008
The Macro will pause automatically for the user to key in the value. After
the key enter or Ok the macro will continue.

Subodh
"Khan" <(E-Mail Removed)> wrote in message
news:84FC81D8-2868-49D0-9EB5-(E-Mail Removed)...
> In the following macro in excel please answer the italic question
> Range("A1").Select
> Selection.End(xlDown).Select
> Selection.End(xlDown).Select
> ActiveCell.Range("A1:G1").Select
> Selection.Copy
> ActiveCell.Offset(1, 0).Range("A1").Select
> ActiveSheet.Paste
> ActiveCell.Select
> Dim x As String
> x = InputBox("Put Value", "abc") ' How can the macro be paused here
> and
> after input what
> key will resume it ?
> ActiveCell.Offset(0, 1).Range("A1").Select
> ActiveCell.Select
>
> End Sub
> Thanks for your help



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a macro be paused to allow input, then continue? Rufushenry Microsoft Excel Worksheet Functions 2 31st Dec 2009 07:01 PM
Edit Cells while Macro is Paused at Message Box Magoo Microsoft Excel Programming 4 28th Feb 2008 07:10 PM
run macro with input msg based on cell input Janelle S Microsoft Excel Misc 0 20th Jan 2008 05:23 AM
Pause Macro Then Resume =?Utf-8?B?bHJlZWNoZXI=?= Microsoft Access Macros 2 25th Jun 2007 01:19 PM
readline, then resume if no input lyndon hughey Microsoft C# .NET 3 25th May 2004 11:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:04 PM.