ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can a macro pause for a data entry before finishing? (https://www.excelbanter.com/excel-programming/429715-can-macro-pause-data-entry-before-finishing.html)

Fan924

Can a macro pause for a data entry before finishing?
 
Can a macro pause for a data entry before finishing?

Rick Rothstein

Can a macro pause for a data entry before finishing?
 
You can use an InputBox to take the new data in... the program will pause
for the user to enter the value...

Dim NewData As Variant
....
....
NewData = Application.InputBox("Give me the new data.")
'
' Do whatever you want with the contents of the NewData
' variable. You may want to check to make sure the user
' actually entered a value before attempting to use the value.
'

--
Rick (MVP - Excel)


"Fan924" wrote in message
...
Can a macro pause for a data entry before finishing?



Jim Thomlinson

Can a macro pause for a data entry before finishing?
 
In short... No. there are a few techniques I have seen posted but in general
they all have pretty significant drawbacks. Here is what you can do

1. Use an input box to get info from the user (good if you only want really
simple input)

2. Use a user form to get user input (good for more complex input)

3. End the macro at the point of requireing input. Catch change events
occuring in the spreadsheet to initiate the final code.
--
HTH...

Jim Thomlinson


"Fan924" wrote:

Can a macro pause for a data entry before finishing?


Patrick Molloy

Can a macro pause for a data entry before finishing?
 
x = Inputbox( )
or
x=Application.Inputbox( ... )



"Fan924" wrote in message
...
Can a macro pause for a data entry before finishing?



Fan924

Can a macro pause for a data entry before finishing?
 
Thanks guys


All times are GMT +1. The time now is 03:31 AM.

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