Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Archive: Business Applications
Tag Cloud
access audio blue screen boot bsod connection crash dell desktop driver dvd email error excel excel 2003 firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor ram recovery router screen slow sound spyware tdlwsp.dll trojan upgrade vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications > Archive: Business Applications >
Solved: Excel Pause Macro for Input into various cells

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
mariaa33's Avatar
Member with 62 posts.
 
Join Date: Aug 2008
Experience: Beginner
10-Oct-2008, 10:58 AM #1
Solved: Excel Pause Macro for Input into various cells
I am trying to find the best way to pause a macro, allow the user to edit the spreadsheet in various cells and then resume the macro. I saw on one site about modeless msgbox but could not find information on how to use it. Any suggestions would be greatly appreciated.
slurpee55's Avatar
Computer Specs
Distinguished Member with 6,294 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
10-Oct-2008, 11:20 AM #2
One of the simpler ways is to add this pause routine to the macro
http://www.mrexcel.com/archive/VBA/869.html
mariaa33's Avatar
Member with 62 posts.
 
Join Date: Aug 2008
Experience: Beginner
10-Oct-2008, 11:23 AM #3
That would not work because it would take X minutes to make the changes. The number of minutes would vary and I would not want to put in too long of a wait or too short of a wait.
slurpee55's Avatar
Computer Specs
Distinguished Member with 6,294 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
10-Oct-2008, 11:26 AM #4
Then I would suggest you use an Input Box.
Here is a good description on how to use them
http://www.ozgrid.com/VBA/inputbox.htm
mariaa33's Avatar
Member with 62 posts.
 
Join Date: Aug 2008
Experience: Beginner
10-Oct-2008, 11:31 AM #5
Already tried that too but it does not allow the user to go to the actual spreadsheet and enter the data as there will be different cells that need to be entered each time it is used. It needs to just pause the macro and allow the user to enter data whereever it is need and when finished the user click "ok" to continue with the macro.
slurpee55's Avatar
Computer Specs
Distinguished Member with 6,294 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
10-Oct-2008, 11:47 AM #6
What does your macro do? I am trying to understand why the user can't make the changes in advance, or have formulas recalculate the values.
If you could post a copy of your spreadsheet (Use Go Advanced - there is an option that you will see then for adding files) then perhaps we could help more.
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.
My theme song... | Affero - rate me!
mariaa33's Avatar
Member with 62 posts.
 
Join Date: Aug 2008
Experience: Beginner
10-Oct-2008, 11:56 AM #7
The spreadsheet is very large and after other formatting, it sorts the data so that the rows with the empty cells are at the top. The cells that are empty require the user to look up data in another application and then enter it into the spreadsheet. It could be anywhere from 1 to 30 different cells that manual entry is needed. After they complete this manual entry I want to continue with the macro.
slurpee55's Avatar
Computer Specs
Distinguished Member with 6,294 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
10-Oct-2008, 12:03 PM #8
Why not just split it into two macros - one that stops after sorting and another that does the rest?
You could assign two buttons that would run one macro each....
mariaa33's Avatar
Member with 62 posts.
 
Join Date: Aug 2008
Experience: Beginner
10-Oct-2008, 12:05 PM #9
That is the way I had it to start with but I was trying to keep the user from having to run several macros. Ok, that may be my only choice. I was looking into using a userform with an ok button. thanks
OBP's Avatar
OBP OBP is online now
Computer Specs
Distinguished Member with 9,334 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
10-Oct-2008, 12:36 PM #10
It sounds like this should actually be in Access, an Access Query would show empty Cells and allow data entry.
slurpee55's Avatar
Computer Specs
Distinguished Member with 6,294 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
10-Oct-2008, 12:36 PM #11
I asked one of the best coders on here about this and he said that you could do it in BASIC but not in VBA. (I would guess you could program in something else also, but....)
An idea I thought of - if there is a cell that they always must enter data into, and it is the last one that they enter data into (or click into) - you could even assign a blank cell to this function; have them type in "ok" or something - but when that cell loses focus, you could auto start the second macro.
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.
My theme song... | Affero - rate me!
Rollin_Again's Avatar
Distinguished Member with 3,728 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
10-Oct-2008, 01:34 PM #12
Create a modeless form with nothing but an OK button on it. When the user runs the macro the code will execute up to the point where the user input is required and then the form will be displayed. Since the form is modeless you can move it and manually enter data into the workbook. When the user clicks the OK button the form should be hidden and the remainder of your macro code should be executed in the button_click event. To make the form modeless just open the form in the VB editor and set the ShowModal property to False. Let me know if you want me to post an example.


Regards,
Rollin

Last edited by Rollin_Again : 10-Oct-2008 01:40 PM.
mariaa33's Avatar
Member with 62 posts.
 
Join Date: Aug 2008
Experience: Beginner
10-Oct-2008, 01:38 PM #13
How would I code that? I have never worked with modeless forms. I have tried to figure it out with some examples on the net but no success.
mariaa33's Avatar
Member with 62 posts.
 
Join Date: Aug 2008
Experience: Beginner
10-Oct-2008, 01:55 PM #14
Unfortunately, my company has blocked that website. They even block google groups.
mariaa33's Avatar
Member with 62 posts.
 
Join Date: Aug 2008
Experience: Beginner
10-Oct-2008, 01:55 PM #15
Wait, I know somewhere I can go. Be there in a min
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 10:25 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.