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.
I'm trying to create a drop down control for each cell that will present the user with values Red, Green, Yellow. Once selected the cell will turn that color.
I am trying to write a worksheet_selectionchange macro in which the change is initiated only when certain cells are changed (B6:B9 and X9). I do not want the change to be initiated when any other cells on the worksheet change. B6:B9 and X9 are drop down boxes and the values within the drop-down boxes is variable.
I'm building a Excel 2003 workbook that needs more than 3 conditional formats. I've tried the code given in the FAQ: Get Around Excels 3 Criteria Limit in Conditional Formatting but this only works on cells being modified directly. I've also tried the code in the post: VBA Conditional Formatting - Refresh when data changes but neither does the job I need.
I'm using a Format Control to present the user with a list of choices. When the control changes the target cell I want to apply a conditional format to that cell. This image shows the form. When the Format Control selection (in B2) is changed I want to apply conditional formating to the target cell (A2).
There will be up to 10 choices and therefore conditions.
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.
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.
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.
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.
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"
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?
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.
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
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.
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
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.
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?
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.
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.
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"
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.
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).
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"
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?
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.
I would like to drop down the cells in B4 and D4 so that if throws up a result in D6 which looks at Sheet 2 and throws back that score? So it will look for Neil in Column A and October in Row 1 and throw back that figure.
I have found a macro that should work with a change of a specific cell.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$7" Then Call Button End If End Sub
However, the code doesn t work as with a change of A7 nothing happens. A7 equals to result from a drop down list --> A7=A5(which is a drop down list value). The "Button" macro is a combination of 4 macros that get rid of zero values and names in pie charts (maybe this plays any role). The master macro is assigned to an object. The code is:
I am using INDIRECT to create a second dynamic drop down list (L1) that is based on the cell contents of a first drop down list (I1). I want to create a macro that will blank the 2nd drop down list ONLY when the choice in the first list is CHANGED. I have the following, but it blanks the second list as soon as the first list is clicked on, rather than when a change is made:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Intersect(Range("I1"), Target) Is Nothing Then Range("L1").ClearContents