Pause Macro - Select From A Drop Down - Restart Macro

Dec 18, 2007

I am trying to pause a macro on a protected sheet, select 2 adjacent cells (initially protected), utilize an existing drop down box to select a name from the list, copy the name from the list into the range of cells, then re-start the macro.
I had no problem when there was just one name (see John Smith below). I tried to use the InputBox command but needed to actually type in the name.

ActiveSheet.Unprotect
Range("C27:D27").Select
'ActiveCell.FormulaR1C1 = "John Smith"
' Application.CutCopyMode = False
' ActiveSheet.Paste
'Range("c27:d27") = InputBox("Enter value")

View 4 Replies


ADVERTISEMENT

Can Pause A Running Macro Then Restart It

Mar 19, 2014

I've written a macro for work that will work with our billing process. After part of it has run, I'd like to pause it for the user to check a column for errors and possibly update a table to get rid of those errors, then after those errors are fixed, have the ability to continue with the rest of the code. I tried to make a message box to remind the user to look for the errors, but it wouldn't allow me to click anywhere except for on the buttons.

View 4 Replies View Related

Pause Macro To Allow User To Select A Cell?

Aug 15, 2014

I am wanting to pause a macro to allow a user to select a cell and when the user hits enter the macro starts running again. My intention is that a user would select cell B5 or B8 or B55 and then hit enter and the cell would move 6 cells right and enter a value from the macro. The following is what I have tried and even though it allows to select a cell, it doesn't make that cell the active cell.

[Code].....

View 3 Replies View Related

Want Macro To Pause, Allow User To Select A Range

Feb 18, 2008

I would like to Pause a macro to allow the user to select a range on the spreadsheet and then click OK to continue with Macro.

I tried to use Msbbox, but I can't figure out how to allow user to access the spreadsheet to highlight the desired range.

View 9 Replies View Related

Pause In VBA Loop Then Restart From Where It Stopped

Jun 17, 2013

I'm looking for a simple solution to pause a VBA loop and then restart it from where it stopped.

Is it with a boolean value, i dont know the code.

View 9 Replies View Related

Pause Macro And Wait For User To Click On Cell To Resume Macro?

Jan 15, 2014

I have a macro where I manually select a cell then the macro kicks in to copy and paste the contents into the Find function. From there it goes to another work sheet, clicks on a cell in column one and searches for matching cell contents. Then If false it manually goes back to the original worksheet/cell and then I input a N in the left adjacent cell. If true I enter a Y. Right now I can only run this for the specific cell the macro was recorded for. I would like to expand this.

What I would like to do create a loop in the macro that waits for my cell choice input then continues with the with the Find function. If false the macro should just loop back to the original worksheet/cell and wait for input, ie the next cell selected. However, if true a worksheet/cell is selected, a Y is input and it loops back to the original cell and waits for input.

View 9 Replies View Related

Select Macro From A Drop-down Menu

Apr 16, 2009

I have several pre-configured macros that I would like to choose from using a drop-down menu. I know this is possible within the excel built-in ribbon, but I need to have it only in the spreadsheet. The macro will be importing a csv file. I have several different csv files that I need to be able to choose from and a drop-down list seems to be the best choice. The other option could be to have the macro prompt me to select the csv file of choice. Below is a sample of the macro that I would be using. Is this possible?

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;P:A Harvest of HealthImportVendorsA-N.txt", Destination:=Range( _
"$N$1"))
.Name = "A-N_7"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells

View 9 Replies View Related

Pause Macro, Allow Format, Resume Macro

Mar 14, 2007

how to interrupt VBA code, allow user modifications to a chart, and then continue the code where it left off with a click of a button. I currently have the code in place where a UserForm pops up at a specific point and tells the user to make adjustments and press OK when done. It works fine but the UserForm displays and the macro resumes when OK is clicked, but I can't figure out how to activate the chart or the spreadsheet to allow editing while that UserForm is on the screen. If only I can get excel to allow me to sleect the spreadsheet and make changes while the UserForm is on the screen, I would be set. Can anyone please help me with any options to allow editing while the UserForm is on the screen so I can edit and then click the OK when done?

I posted something similar to this over two years ago. The way I got around it at the time was to break the code into two separate subs. This time around, the code is making 17 graphs and I want to ask for editing for each one before continuing. That would be a lot of individual sections of code.

View 9 Replies View Related

Stop And Restart Macro(s) Programatically

Jan 20, 2010

I've got a series of macros in place which, essentially, download several CSV files into a temp directory, then opens each and copies the data into a single workbook (one sheet).

What happens is that the some number of the sheets don't actually open until the macro stops. I've tried using the wait (Application.Wait Now + TimeValue("00:00:10")) and sleep functions, but it's not quite doing what I want.

What I'd LIKE to do is have the macro actually STOP processing for 10 seconds, then proceed (or start a new macro).

I've also tried putting the wait behind a button in a userform, which is non modal... the csv files open until the user clicks the button.

View 9 Replies View Related

Excel Macro To Automatically Restart PC?

Aug 15, 2013

Is it possible to write a code that will automatically restart a PC when a STRING in CELL A1 is recognized? My cell A1 populates a user's USERNAME upon opening the workbook.

View 9 Replies View Related

VBA MVP's: Restart Windows Service With A Macro

Feb 10, 2010

Is it possible to restart a Windows Service with execution from a VBA Macro?

When you go into Windows Computer Management you can see a list of services. You can click a hyperlink to start, pause or restart.

View 9 Replies View Related

Restart Macro Sub Procedure From Beginning

Jun 26, 2008

When I run the following code, if "If exists = True" then I want the routine to start again at the very beginning. Currently, 'as is' it re-starts at the beginning but enters a loop on itself; I understand why this is but it's not what I want but can't get round this! How do I make the "If exists = True" condition (if true) restart the routine - ie call AllNEWActions() without then going into a loop on itself? NB: I can't use "Exit Sub" (see it commented out) as I don't want to exit routine, just restart it.

Sub AllNEWActions()
ShowCalendar
GetDateFromCalendar
SheetAlreadyExists
If exists = True Then
boolRestart = True
AllNEWActions
' Exit Sub
Else
MsgBox (" Date selected/new sheet doesn't exist")
InsertNewSheet
End If
If boolRestart = False Then
ShowCalendar
GetDateFromCalendar
End If

MsgBox ("Do something ...)
End Sub

View 2 Replies View Related

Allow User To Restart Macro Or Close Workbook

Jun 25, 2008

I have a macro that runs when the workbook opens. At the end of my macro I've added a Yes/No box. If 'No' the workbook closes without saving. If 'Yes' I would like to restart the macro. I can close it ok, but I don't know how to restart the macro from line 1 when 'Yes' is selected. Here is what I have:

YesNo = MsgBox("Done! Would you like to run again?", vbYesNo + vbCritical, "Caution")
Select Case YesNo
Case vbYes

'I don't know what to put here :(

Case vbNo
ActiveWorkbook.Close savechanges:=False
End Select

View 3 Replies View Related

Pause Macro And Then Run It After 10 Minutes?

Oct 23, 2012

is there a code i can have where i can a pause a macro and then run it after 10 mins from that point?

View 5 Replies View Related

Pause Or Stop Macro

Jun 24, 2006

I am running a macro that populates the same chart with variable data. I have approximately 40 sets of data and wish to pause or stop the macro to view one of the sets of data more closely. The pause option would be better but Stop option is acceptable

View 2 Replies View Related

Pause Macro Execution Without Using Stop?

Jul 3, 2014

I have macros that often pause for the user to take some action -- for instance, to confirm that the correct cells are selected, or to delete something. Usually I use the "Stop" command, which opens the VBA editor; when I finish doing the manual action, I just resume the macro.

When writing macros for actual users, I'd like to do the same thing without their having to deal with the VBA window. Is there a way to pause and resume action and remain in the Excel window?

View 3 Replies View Related

Macro Pause Then Resume By Keystroke

Nov 11, 2012

Is there a way a macro can be paused then resume running the macro by a keystroke, not a time delay.

View 3 Replies View Related

Adding Pause To Existing Macro?

Mar 21, 2013

I would like to add a pause to the following macro so that it inserts the word CANCEL 1 second after triggering. I know I need to use the Application.Ontime function but cannot work out how to integrate it.

Code:
Sub Cancel() Application.ScreenUpdating = False
Sheets("Sheet1").Range("T5") = "CANCEL"
Application.ScreenUpdating = True
End Sub

View 3 Replies View Related

Can I Pause And Then Start Recording Macro Again

Nov 17, 2006

I'm recording a Macro but I want to test certain section before I complete it, so can I pause the recording and then restart the recording again?

View 9 Replies View Related

Macro To Pause Code, Another To Resume

Jul 27, 2007

I have a workbook with several hundred row the VBA code loops through. It takes about an hour to run all the calculations. Whenever I need to pause the script I hit ESC, which works well for me, but for other users it would be nice to have a command button that halts code. Even better would be another button to resume code.

View 9 Replies View Related

Showcase Query: Pause Macro

Nov 21, 2006

I am running a Showcase query from inside excel. I want the query to update, drop the data in excel save it and then close. The problem is that the save command is executing before the data is dropped. The Wait command pauses all processes so it won't work. Is there a way to have a minute of filler until the data is dropped so it will save?

View 5 Replies View Related

Macro To Select VbYesNo When Calling Another Macro

Apr 20, 2008

I have a workbook with a 2 macros "PopulateSheetlist" and "SaveEditedversion"

Normally they are each button operated, and prompt the user with vbYesNo style options. I wanted to write a Macro, say "Macroautomatewkbk that would automatically answer the prompts.


Sub Macroautomatewkbk ()

Call PopulateSheetlist

' Always answer YES or OK to any prompts this macro may offer

Call SaveEditedversion

' Answer No for the 1st prompt and YES for the 2nd prompt

End Sub

MsgBox "Both macros "PopulateSheetlist" and "SaveEditedversion"

' Some error handler here, don't know how this should work exactly.
Could any one please explain how to fill in code in the commented sections in the above sample code?

Edit: I tried recording a macro to do the above, but it only showed the zooming and scrolling that occurred, none of the button prompts being answered.

View 9 Replies View Related

Run Part Of Macro, Pause, Run 2nd Part

Aug 4, 2007

I have 2 basic parts to a Macro which need to be separated by a pause of 1 second, before proceeding to the next part of the macro. Then pause for 1 second, and loop.

Application.Wait is no good to me as the spreadsheet must remain live, editable, and receiving updates from an external program linked via DDE. Below is the ...

View 6 Replies View Related

Drop Down Listing Macro

May 26, 2009

Ok well here goes.

I have an excel book with 2 sheets.

Sheet 1 = dropdown
Sheet 2 = Customer list

What i need is a to be able to add to the customer list on sheet 2 and in the process the customer list to be sorted into alphabetical order.

In addition I need the new customer to be added into the dropdown list on sheet 1.

I know i can extend the list in sheet 2 with blanks so that there is space in the drop down list, but not knowing the number of customers at any one time I have no way of knowing how many blanks to add.

View 12 Replies View Related

Macro To Run From A Drop Down List

Dec 4, 2008

When someone makes ANY selection from my drop-down list, I would like my macro to run so that the user can continue to fill in the rest of the form. My macro simply unhides some rows as below:

Sub UnhideForm()
Application.EnableCancelKey = xlDisabled
ActiveSheet.Unprotect Password:="Testing"

Rows("15:112").Select
Selection.EntireRow.Hidden = False
Range("Name").Select

ActiveSheet.Protect Password:="edit"

End Sub

Here's some info you might need:My sheet is called "Form"
My macro is called "UnhideForm"
My drop-down list is in the array called "TypeOfMoveCell"
I have 5 dropdown options (which includes an option called "Please select from list...") These options are located in cells BW145:BW148.
I would also like the macro to re-hide the data rows if someone deletes the value in the drop-down list, or if someone re-selects "Please select from list..." option.

View 9 Replies View Related

Drop-down Box Value To Trigger Macro

Jun 21, 2006

A1 is a drop-down list, created from Data> Validation>List, which lists 3 different words (Text1, Text2, Text3). I have recorded 3 macros (Macro1, Macro2, Macro3). Here's what I want to happen:

When Text1 is selected in A1, I want Macro1 to run (same for Text2/Macro2 and Text3/Macro3). I want the user to be able to change this value as many times as they wish and have the corresponding Macro run each time. I've tried creating the appropriate code in Editor using other threads on this forum, but I can't seem to figure it out.

View 8 Replies View Related

Macro (Select, Sort And Select)

Nov 16, 2006

I need to get a macro to select all the data in column "A", sort it in ascending order, omit the blanks if any, then select (highlight) all the data so that another macro can be run.

When I record it, it will only record up to the last row I highlight but the data always changes so there could be more or less.

View 9 Replies View Related

Drop Down Chart To Run A Graph Macro

Mar 6, 2007

I am trying to figure out how to activate a macro from each item in a drop down list. I also need the macro to recognize which item is chosen and to use that items data (say cells C3:C11) to create its graph. I know how to create an individual macro that will create a graph for the item but not a general macro that can be used to graph all items just discerning the difference in where the data is (which item to graph). Is this possible????if so please include code (amatuer programmer).

View 9 Replies View Related

Macro Executed By Drop-down List. How

Mar 30, 2009

I have a macro which output depence on the variable input. Input is represented by drop-down list. Before, I was choosing input from drop-down, then pressing the button my macro was running. Now, I'm thinking to if it's possible to exclude a spare operation from button pressing, just by clicking from drop-down.

My drop-down list is created through "Data->Validation->List box"

View 9 Replies View Related

Create A Drop-down List To Run Macro

Oct 19, 2006

I'm able to create a simple User form Drop-down list that references a cell range list. ( as a test for myself) I have 4 separate macros I would like to run individually. Rather than create 4 separate buttons, I'd like to be able to select each one via Drop-Down list.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved