ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Stopping a Macro (https://www.excelbanter.com/excel-programming/395429-stopping-macro.html)

Felix

Stopping a Macro
 
I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not seem to
work
--
Felix

OssieMac

Stopping a Macro
 
You could try InputBox function to get user input and populate the required
cell from the input.

Regards,

OssieMac

"Felix" wrote:

I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not seem to
work
--
Felix


Felix

Stopping a Macro
 
Thank you,

will this stop the Macro and resume after entry?
--
Felix


"OssieMac" wrote:

You could try InputBox function to get user input and populate the required
cell from the input.

Regards,

OssieMac

"Felix" wrote:

I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not seem to
work
--
Felix


Bob Phillips

Stopping a Macro
 
The macro will wait until input is complete, and then will pick up after
that input (or Cancel).

You need to code for the result. Look it up in help.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Felix" wrote in message
...
Thank you,

will this stop the Macro and resume after entry?
--
Felix


"OssieMac" wrote:

You could try InputBox function to get user input and populate the
required
cell from the input.

Regards,

OssieMac

"Felix" wrote:

I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait
until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not
seem to
work
--
Felix




Felix

Stopping a Macro
 
I tried the folling statement:

=INPUT("Enter Data",1)

but there is an error: "Expects #"


I want simply go to Cell A6, wait for an entry and resume with the Macro.


--
Felix


"OssieMac" wrote:

You could try InputBox function to get user input and populate the required
cell from the input.

Regards,

OssieMac

"Felix" wrote:

I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not seem to
work
--
Felix


Bob Phillips

Stopping a Macro
 
You are in the programming group, so it is InputBox, and it is VBA

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Felix" wrote in message
...
I tried the folling statement:

=INPUT("Enter Data",1)

but there is an error: "Expects #"


I want simply go to Cell A6, wait for an entry and resume with the Macro.


--
Felix


"OssieMac" wrote:

You could try InputBox function to get user input and populate the
required
cell from the input.

Regards,

OssieMac

"Felix" wrote:

I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait
until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not
seem to
work
--
Felix




Felix

Stopping a Macro
 
Thank you!

the following

Sub EnterData()
'
' EnterData Macro
' Macro grabada el 14.08.2007 por fak
'
'
Application.Goto Reference:="R1C1"
InputBox (Enter)

Application.Goto Reference:="R5C8"

End Sub


works fine, Macro goes to A1, displays Box (without "Enter"...), but when I
fill in a value in the box, it is not accepted in cell A1. The macro then
continues going to A5.

It also asks for a "prompt" and default.


--
Felix


"Bob Phillips" wrote:

You are in the programming group, so it is InputBox, and it is VBA

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Felix" wrote in message
...
I tried the folling statement:

=INPUT("Enter Data",1)

but there is an error: "Expects #"


I want simply go to Cell A6, wait for an entry and resume with the Macro.


--
Felix


"OssieMac" wrote:

You could try InputBox function to get user input and populate the
required
cell from the input.

Regards,

OssieMac

"Felix" wrote:

I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait
until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not
seem to
work
--
Felix





[email protected]

Stopping a Macro
 
On 14 Aug, 10:48, Felix wrote:
Thank you!

the following

Sub EnterData()
'
' EnterData Macro
' Macro grabada el 14.08.2007 por fak
'
'
Application.Goto Reference:="R1C1"
InputBox (Enter)

Application.Goto Reference:="R5C8"

End Sub

works fine, Macro goes to A1, displays Box (without "Enter"...), but when I
fill in a value in the box, it is not accepted in cell A1. The macro then
continues going to A5.

It also asks for a "prompt" and default.

--
Felix



"Bob Phillips" wrote:
You are in the programming group, so it is InputBox, and it is VBA


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)


"Felix" wrote in message
...
I tried the folling statement:


=INPUT("Enter Data",1)


but there is an error: "Expects #"


I want simply go to Cell A6, wait for an entry and resume with the Macro.


--
Felix


"OssieMac" wrote:


You could try InputBox function to get user input and populate the
required
cell from the input.


Regards,


OssieMac


"Felix" wrote:


I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait
until
a value is entered and have the macro continue. (after ENTER ?)


I tried something with the PAUSE / RESUME commands, but it does not
seem to
work
--
Felix- Hide quoted text -


- Show quoted text -


try

range("A1").value=inputbox("enter")


Felix

Stopping a Macro
 
Thank you, I tried the following:


Sub EnterData()
'
' EnterData Macro
'
'
Application.Goto Reference:="R1C1"
InputBox (Enter)
Range("A1").Value = InputBox("enter")
Application.Goto Reference:="R8C5"
End Sub

Result: The value entered in the box (a number) is not in A1, however, the
word "enter" is now written onto the box.

I would need: The text "Please enter value" on the box and a numeric value
be put is cell A1.
--
Felix


" wrote:

On 14 Aug, 10:48, Felix wrote:
Thank you!

the following

Sub EnterData()
'
' EnterData Macro
' Macro grabada el 14.08.2007 por fak
'
'
Application.Goto Reference:="R1C1"
InputBox (Enter)

Application.Goto Reference:="R5C8"

End Sub

works fine, Macro goes to A1, displays Box (without "Enter"...), but when I
fill in a value in the box, it is not accepted in cell A1. The macro then
continues going to A5.

It also asks for a "prompt" and default.

--
Felix



"Bob Phillips" wrote:
You are in the programming group, so it is InputBox, and it is VBA


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)


"Felix" wrote in message
...
I tried the folling statement:


=INPUT("Enter Data",1)


but there is an error: "Expects #"


I want simply go to Cell A6, wait for an entry and resume with the Macro.


--
Felix


"OssieMac" wrote:


You could try InputBox function to get user input and populate the
required
cell from the input.


Regards,


OssieMac


"Felix" wrote:


I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait
until
a value is entered and have the macro continue. (after ENTER ?)


I tried something with the PAUSE / RESUME commands, but it does not
seem to
work
--
Felix- Hide quoted text -


- Show quoted text -


try

range("A1").value=inputbox("enter")



OssieMac

Stopping a Macro
 
Hi Felix,

Sorry I did not get back to you sooner. It looks like you need a little more
help than just a pointer in the right direction.

The following is an example of using InputBox with handling user cancelling
instead of entering data. Note that clicking OK on InputBox without entering
data is the same as clicking cancel.

Sub Input_Data()
Dim exitInput As Boolean
Dim msgResponse

exitInput = False

Range("A1").Select

Do While exitInput = False

Range("A1").Value = InputBox("Enter data for cell A1")

If Range("A1") = "" Then
msgResponse = MsgBox("You cancelled without entering data" _
& Chr(13) & "Click Yes if you meant to cancel or" _
& Chr(13) & "No if you still want to enter data", vbYesNo)

If msgResponse = vbNo Then
exitInput = False
Else
exitInput = True
End If
Else
exitInput = True
End If
Loop

End Sub

Regards,

OssieMac



"Felix" wrote:

Thank you, I tried the following:


Sub EnterData()
'
' EnterData Macro
'
'
Application.Goto Reference:="R1C1"
InputBox (Enter)
Range("A1").Value = InputBox("enter")
Application.Goto Reference:="R8C5"
End Sub

Result: The value entered in the box (a number) is not in A1, however, the
word "enter" is now written onto the box.

I would need: The text "Please enter value" on the box and a numeric value
be put is cell A1.
--
Felix


" wrote:

On 14 Aug, 10:48, Felix wrote:
Thank you!

the following

Sub EnterData()
'
' EnterData Macro
' Macro grabada el 14.08.2007 por fak
'
'
Application.Goto Reference:="R1C1"
InputBox (Enter)

Application.Goto Reference:="R5C8"

End Sub

works fine, Macro goes to A1, displays Box (without "Enter"...), but when I
fill in a value in the box, it is not accepted in cell A1. The macro then
continues going to A5.

It also asks for a "prompt" and default.

--
Felix



"Bob Phillips" wrote:
You are in the programming group, so it is InputBox, and it is VBA

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Felix" wrote in message
...
I tried the folling statement:

=INPUT("Enter Data",1)

but there is an error: "Expects #"

I want simply go to Cell A6, wait for an entry and resume with the Macro.

--
Felix

"OssieMac" wrote:

You could try InputBox function to get user input and populate the
required
cell from the input.

Regards,

OssieMac

"Felix" wrote:

I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait
until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not
seem to
work
--
Felix- Hide quoted text -

- Show quoted text -


try

range("A1").value=inputbox("enter")



OssieMac

Stopping a Macro
 
Hi again Felix,

Just a little extra for you. I'll point out the problems with the macro you
posted.

Application.Goto Reference:="R1C1"

InputBox (Enter) 'This line is NOT correct and not required. (Delete it.)

'In the following line A1 is assigned the value that you enter in the
InputBox.
Range("A1").Value = InputBox("Please enter value")
Application.Goto Reference:="R8C5"

Note: You are entering the value in the input box and not trying
to enter a value directly in the cell A1 aren't you because you cannot
enter it directly in the cell; it must be in the input box and the code
then assigns the value to the cell.

The message between the double quotes in the InputBox function can be
any message you like. I have edited yours to what you requested.

You could use the above code if you do not want any validation of whether
the user actually enters data.

Regards,

OssieMac

"Felix" wrote:

Thank you, I tried the following:


Sub EnterData()
'
' EnterData Macro
'
'
Application.Goto Reference:="R1C1"
InputBox (Enter)
Range("A1").Value = InputBox("enter")
Application.Goto Reference:="R8C5"
End Sub

Result: The value entered in the box (a number) is not in A1, however, the
word "enter" is now written onto the box.

I would need: The text "Please enter value" on the box and a numeric value
be put is cell A1.
--
Felix


" wrote:

On 14 Aug, 10:48, Felix wrote:
Thank you!

the following

Sub EnterData()
'
' EnterData Macro
' Macro grabada el 14.08.2007 por fak
'
'
Application.Goto Reference:="R1C1"
InputBox (Enter)

Application.Goto Reference:="R5C8"

End Sub

works fine, Macro goes to A1, displays Box (without "Enter"...), but when I
fill in a value in the box, it is not accepted in cell A1. The macro then
continues going to A5.

It also asks for a "prompt" and default.

--
Felix



"Bob Phillips" wrote:
You are in the programming group, so it is InputBox, and it is VBA

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Felix" wrote in message
...
I tried the folling statement:

=INPUT("Enter Data",1)

but there is an error: "Expects #"

I want simply go to Cell A6, wait for an entry and resume with the Macro.

--
Felix

"OssieMac" wrote:

You could try InputBox function to get user input and populate the
required
cell from the input.

Regards,

OssieMac

"Felix" wrote:

I read in an old Microsoft Excel "Function Reference Book" that it is
possible to stop a running Macro (at a particular cells or cells), wait
until
a value is entered and have the macro continue. (after ENTER ?)

I tried something with the PAUSE / RESUME commands, but it does not
seem to
work
--
Felix- Hide quoted text -

- Show quoted text -


try

range("A1").value=inputbox("enter")




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com