Trigger Actions For Three Choices In A Macro
Dec 30, 2009
I have a series of macros altering various workbooks and sheets. They're numbered Step1, Step2, etc. In my Step5 I have a series of Case statements in a macro, and I don't know how to get it to do what I want next. I have NOT tried running this code yet, and I'm sure I have something(s) wrong in it.
1) If the selection in DstWbk, sheet "Steps", is "01DSP" through "11DSP" the macro needs to delete specific columns in the SrcWbk, and then move to the next step (6).
2) If the selection in DstWbk, sheet "Steps", is "*DSP" the macro needs to go directly to the next step (6)
3) If the selection in DstWbk, sheet "Steps", is anything else the macro needs to flash a generic "No Data found" message and move on to Step7.
The part of the code that's throwing me begins at 'Select only the specific regional data' and ends at the "Case Else MsgBox"
View 3 Replies
ADVERTISEMENT
Oct 4, 2009
I need to insert code into an existing macro that does each of these two similar actions:
If a specified word is in the heading (row 1 cell) of a sheet, DELETE that column
If a specified word is in the heading (row 1 cell) of a sheet, BOLD that column.
View 9 Replies
View Related
Jul 1, 2014
I have the code below that is two separate activities and I want to change the second activity from a cell trigger (Set KeyCells = Range("K42:AD42")) to a button trigger. I need to first to remain unchanged.
I'd be ok if this was just one macro that I could assign to a button but because its two and I need to write the second's to clicking a button I'm over my head.
Its occured to me while writing this that because it'll be a range of buttons I'll probably need to make each one an individual code? Is this the case? If so I may have to just keep this as it is.
View 2 Replies
View Related
Dec 8, 2006
I have written a macro which references to several different sheets and cells therein. The macro is assigned to a command button on 'Sheet 1'. When I click the command button, the screen flickers and the user can see the macro running all the commands I have written. Is there a way of stopping this - maybe replacing it with a static screen view whilst the macro runs?
View 3 Replies
View Related
Feb 22, 2009
I want to trigger a macro that refreshes a pivot table but I only want to trigger the macro after 15 seconds. The reason is that I am pulling the source data from access mdb so I want only to refresh the data once the data is pulled.
View 3 Replies
View Related
Jan 25, 2014
Is it possible to trigger a macro on a condition like this?
If date more than 1 week arrange date in sequence order.
View 2 Replies
View Related
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
Dec 5, 2008
When I open my workbook it also opens a separate workbook and hides second book.
when I close myworkbook I want to unhide the hidden one and close it without saving.
View 4 Replies
View Related
Feb 18, 2009
is possible to trigger a macro at the start of every month. I have a fairly simple bit of VBA, but just want it to execute on the 1st of every new month.
View 3 Replies
View Related
Apr 24, 2007
I'm creating a small Excel RPG where the player moves the around a blank worksheet with the walls of a maze appearing as you approach them (think dark corridors, you can see only 1 cell in all directions around you).
The players current location is shown by excel setting the activecell to the players location. Currently I have four buttons labeled Up, Down, Left and Right which the player clicks to move in the desired direction.
The testers were frequently missing the four movement buttons and this would put the activecell outside of the maze next to one of the buttons. They'd have to move it back manually.
I would like for the players to move around using the arrow keys to use the activecell, as you would normally move around a sheet... but before each movement there is a procedure that check IF the player can move in the desired direction or not (cell borders used for walls), and then once they've moved there are more procedures to check for monsters treasure chests etc.
How can I make the arrow keys trigger the macros that the Up, Down, Left and Right buttons currently trigger, and not just move the activecell?
View 9 Replies
View Related
Jun 28, 2008
Does anyone no a way to trigger a macro by just using the enter key in a difined rage ("A1:A100") Not worksheetchange
View 9 Replies
View Related
Jan 14, 2004
I have a macro I'd like to run when a worksheet tab is selected. The macro updates content in various cells.
That action is now triggered with a command button (linked to macro), but I'd like it to take place when the user selects that worksheet tab.
View 9 Replies
View Related
Feb 21, 2010
I have a single workbook with five spreadsheets. My goal is to move data along a path (or work flow) from one sheet to the next by using a "trigger" pulldown menu choice.
Sheet1 = Prospects
Sheet2 = New Sale
Sheet3 = Upgrade Sale
Sheet4 = Won
Sheet5 = Lost
Sheets 1, 2, and 3 use the same data layout for column A - K.
Sheets 4 and 5 have the same A - K as above and also have columns L - R in common.
The last column in sheet 1, 2 and 3 is a pulldown menu (New, Upgrade, Won, Lost).
Data rows on each sheet start at row 7.
The goal is to use the pulldown choice to remove the data from the current sheet (ex: Prospect) and add it to the next open row in the required sheet (ex: New or Upgrade). I also need to be able to make a similar move from New/Upgrade to Won or Lost.
View 11 Replies
View Related
Jun 19, 2013
If for example cell A1 begins empty with no data in it other than a formula and something occurs to change the state of cell A1 to a value which triggers a change in cell B1 (a variable), can I use this to fire a sheet change macro ????
Wish to trigger a macro on sheet change based on every cell in column C, is this even possible ???
Or, is a change in a variable (C1) for example, the same as that of a DIRECT user keyboard input for example ???
Code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim c As Range
If Not Application.Intersect(Target, Columns(3)) Is Nothing Then
Application.EnableEvents = False
For Each c In Target
[Code]...
View 7 Replies
View Related
Jul 2, 2013
I am using the...
Private Sub Workbook_BeforeClose(Cancel As Boolean)
... to capture when a user is about to close a workbook. I then give them a message: "Are you sure you want to exit? Changes you made since you last saved will be lost."
However, to make it neater, is there a way to only trigger the macro if they have made changes since the last save? In other words, if they have not made any changes since the last save, the message will not be displayed, since it is irrelevant.
View 2 Replies
View Related
Dec 6, 2013
Colouring calendar entries based on a date match... VBA to colour a cell on each line based on date match
The code works fine if you change the date in the cell and press enter however my date changes are triggered via a Vlookup which the code doesn't recognise has changed so doesn't trigger the macro.
Is there any way to amend the VBA code shown below so that it triggers the macro when dates are changed in column I via Vlookup?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("I:I")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Target.EntireRow.Interior.ColorIndex = xlNone
[Code] ......
View 3 Replies
View Related
Mar 8, 2008
I have an application that updates the text string in A1 every x minutes (time may vary). I'm trying to develop a toutine that will trigger a Macro/call a function/subroutine once only on each change of data (and then not trigger again until the next change...and must only trigger on change of data in this specific cell). So the timeline looks like this
start A1 = "Apples", Fire macro once
start + 10mins A1 = "Oranges", Fire Macro Once again
start + 25mins A1 = "Pears", Fire Macro Once again
etc.
Triggering the macro is no problem but constraining to one triggering is proving a problem (for me anyway) and is really holding up my application progress.
View 5 Replies
View Related
Jul 26, 2014
I'm using macros to apply some complex sorting criteria. It is also applying some cell formatting specific to the sort criteria being applied.
At the start of each macro, I'm resetting all cell formatting to remove any formerly applied formatting that is not correct for the new sort criteria. Basic stuff.... works fine.
Now I need to ensure all formatting created by any macro-generated sort gets removed if a user applies a sort using any sort function from the Ribbon. (Reset all formatting prior to any 'manually applied' sort).
I can create the macro to reset the formatting, just not sure how to trigger it upon user action.
Is it possible to trigger a short macro to reset cell formatting when a user applies a sort using the Data>Sort, Data>Sort Ascending, or Data>Sort Descending commands from the Ribbon?
View 9 Replies
View Related
Jan 18, 2014
I need to repeat the following two actions one after another therefore I cannot use F4 key
The actions are :
1) select some cells in two rows and colour them yellow.
2) select the last two cells of the rows ans merge them.
these are one after another where F4 will repeat only the 2nd step but I need the 1st step of colouring.
Are there any short cut keys or method or recording to repeat the above steps when necessary.
View 1 Replies
View Related
Jul 17, 2009
I have a list of petroleum accumulations with three types of data: Reservoir depth, Net Pay and Gas-oil ratio. for each accumulation, the number of reservoirs within each can vary. So I may have a accumulation with only one set of those stats, or an accumulation with 20.
I need the program to go down an alphabetized list (8000 entries long) and after every unique accumulation name average the values of the stats(which are in three separate columns) then put it in one row perhaps beginning in Column M or another sheet. So that I have a list of accumulations with the average of those stats, one entry per accumulation name.
View 5 Replies
View Related
Jul 3, 2014
I need to assign two actions to a one button.
1. action: Copy Column A, paste to Column C
2. Write time&date into G5
I am only capable of doing one button for each action using the macro recorder and simple code:
[Code] .....
View 2 Replies
View Related
Jul 15, 2014
I am working on trying to make a macro I wrote run faster, and I understand that one way to do this is to stop certain actions from occurring. However, I am having a hard time understanding what stops what, specifically among these:
[Code] ......
View 2 Replies
View Related
Sep 10, 2012
This Coding is correct for CheckBox49. This code Changes the Color of one Cell from Black to white and the cell below it from white to black...(its a dipswitch) when the check box is checked... When its unchecked it does the opposite....
Code:
' ACM 1 Switch 1
Private Sub CheckBox49_Click()
If CheckBox49.Value = True Then
Range("AC24").Select
With Selection.Interior
.Pattern = xlSolid
[Code] ........
Now what needs to happen is this.... I'd Like to have this Happen if checkx49 is checked...
Code:
Range("A1,K50,K51,R50,R51").Select
Range("R51").Activate
With Selection.Interior
.Pattern = xlSolid
[Code] .......
If Checkbox49 is unchecked do this... Put in D26 Reader Name? in Italics.
Code:
Range("K50,K51,R50,R51").Select
Range("R51").Activate
With Selection.Interior
.Pattern = xlNone
[Code] .........
Also...what ever information is entered in D23.
Put that in F50 with RDR at the end...
Whats in D23 Put in F51
Whats in D23 Put in M50 and concatenate with a space from cell U49
Whats in D23 Put in M51 and concatenate with a space from cell Y49
Lastly code to select K50, K51, R50, and R51...=Len whats in F50, F51, M50, and M51 when the box is checked...and dont len when the box is unchecked.
View 6 Replies
View Related
Feb 7, 2014
I am currently using a product formula in a cell and was wondering if I could add a round up/down action to numbers containing decimals? For example, let's say that my cell values are 300, 327.6 and 355.2 after using the product formula. Is it possible for those values to reflect 300, 328 and 355, respectively?
View 5 Replies
View Related
Sep 20, 2007
Is there a structure inside of Excel which keeps track of all the actions taken by a user (something that would presumably be used to allow for an undo sequence)? If so, is there a way to get access to it?
View 2 Replies
View Related
Jun 10, 2014
Any way to trigger a macro in one cell whenever there's an input in another cell.
Attached is the example excel of what I want to achieve.
macro trigger.xlsx
View 9 Replies
View Related
Jan 15, 2014
I want know the formula for below issue. I have number of of actions done for each day for a month or more.
If I select a particular period for example 01jan14 to 10jan14 i want to get all actions done in this period.
View 2 Replies
View Related
Sep 26, 2013
I'm using a Private Sub Worksheet_Change(ByVal target As Range) macro on Worksheets(2) to perform certain actions when a selection from Worksheets(1) is pasted to Worksheets(2). Before ending the Worksheet_Change sub I'd like it to deselect the copied selection on Worksheets(1). I've tried to do this by selecting Worksheets(1) and moving the cursor, but VB ignores the "With Application.Worksheets(1)" instruction. Removing "Private" from the sub heading makes no difference.
Is it possible do this with a Worksheet_Change routine? If so, how?
View 7 Replies
View Related
Apr 28, 2009
I am trying to use following codes for a add-in utility so that user can enable or disable logging activity for a given workbook.
My problem is to how to add the following code to a new workbook so that "Loginfo" function could be activated. I have tried some application... based commands but it do not seem to be working.
View 6 Replies
View Related
May 2, 2009
I have made an class and created a file to log when user change value or insert formula in a sheet get recorded in a file C:Logme.csv. The problem is it is recording the value and formula at random i.e in some instances it records the value and in some instances it is not recording the value and formula in logme.csv . I am unable to figure out why this is happening?
View 3 Replies
View Related