Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default pausing a macro to input cell contents

My first macro using XP, Excel 2003.

During the Recording of a macro, what syntax/keystroke is required to
'pause' a macro so as to allow input of data into a cell address, and then
re-initate continuance of the macro to its next step? I do not want to end
or stop the macro, just pause it automatically to enter data.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default pausing a macro to input cell contents

Pause for input........................

Sub getuserinput()
'some of your code goes here
usrinput = InputBox("enter a number")
Range("A1").Value = usrinput
'resume rest of code
End Sub

Or if you want to select a cell or range to operate on...........

Sub selectit()
'your code
Set srng = Application.InputBox(prompt:= _
"Select a Range of cells", Type:=8)
'do something with srng
End Sub

Combination of the two above into one...............

Sub selectit()
usrinput = InputBox("enter a string")
Set srng = Application.InputBox(prompt:= _
"Select a Range of cells", Type:=8)
For Each cell In srng
cell.Value = usrinput
Next
End Sub


Gord Dibben MS Excel MVP

On Mon, 12 Jan 2009 16:38:06 -0800, blipityblap
wrote:

My first macro using XP, Excel 2003.

During the Recording of a macro, what syntax/keystroke is required to
'pause' a macro so as to allow input of data into a cell address, and then
re-initate continuance of the macro to its next step? I do not want to end
or stop the macro, just pause it automatically to enter data.


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default pausing a macro to input cell contents

Thank you very much. I now realize I must read a book on Visual Basic in
order to construct an auto-record Excel macro. Likely I'll simply go back to
Quattro Pro which has been working well for 18 years.

"Gord Dibben" wrote:

Pause for input........................

Sub getuserinput()
'some of your code goes here
usrinput = InputBox("enter a number")
Range("A1").Value = usrinput
'resume rest of code
End Sub

Or if you want to select a cell or range to operate on...........

Sub selectit()
'your code
Set srng = Application.InputBox(prompt:= _
"Select a Range of cells", Type:=8)
'do something with srng
End Sub

Combination of the two above into one...............

Sub selectit()
usrinput = InputBox("enter a string")
Set srng = Application.InputBox(prompt:= _
"Select a Range of cells", Type:=8)
For Each cell In srng
cell.Value = usrinput
Next
End Sub


Gord Dibben MS Excel MVP

On Mon, 12 Jan 2009 16:38:06 -0800, blipityblap
wrote:

My first macro using XP, Excel 2003.

During the Recording of a macro, what syntax/keystroke is required to
'pause' a macro so as to allow input of data into a cell address, and then
re-initate continuance of the macro to its next step? I do not want to end
or stop the macro, just pause it automatically to enter data.



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default pausing a macro to input cell contents

Yes, unfortunately you cannot record a macro and get things like InputBoxes.

You have to read a book or look to the VBA Help section of Excel


Gord

On Tue, 13 Jan 2009 10:26:01 -0800, blipityblap
wrote:

Thank you very much. I now realize I must read a book on Visual Basic in
order to construct an auto-record Excel macro. Likely I'll simply go back to
Quattro Pro which has been working well for 18 years.

"Gord Dibben" wrote:

Pause for input........................

Sub getuserinput()
'some of your code goes here
usrinput = InputBox("enter a number")
Range("A1").Value = usrinput
'resume rest of code
End Sub

Or if you want to select a cell or range to operate on...........

Sub selectit()
'your code
Set srng = Application.InputBox(prompt:= _
"Select a Range of cells", Type:=8)
'do something with srng
End Sub

Combination of the two above into one...............

Sub selectit()
usrinput = InputBox("enter a string")
Set srng = Application.InputBox(prompt:= _
"Select a Range of cells", Type:=8)
For Each cell In srng
cell.Value = usrinput
Next
End Sub


Gord Dibben MS Excel MVP

On Mon, 12 Jan 2009 16:38:06 -0800, blipityblap
wrote:

My first macro using XP, Excel 2003.

During the Recording of a macro, what syntax/keystroke is required to
'pause' a macro so as to allow input of data into a cell address, and then
re-initate continuance of the macro to its next step? I do not want to end
or stop the macro, just pause it automatically to enter data.




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
macro with input msg based on cell contents Janelle S[_2_] Excel Discussion (Misc queries) 2 February 9th 08 11:47 PM
Pausing a macro Alex.W Excel Discussion (Misc queries) 2 August 10th 07 11:30 AM
Is there a way of pausing a macro Shazza Excel Discussion (Misc queries) 2 March 12th 07 10:59 PM
Pausing a Macro PaulW Excel Discussion (Misc queries) 0 May 30th 06 02:05 PM
Spreadsheet pausing,calculating cells,up2 100%,each input,why? Matticace Excel Discussion (Misc queries) 1 August 23rd 05 01:33 PM


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