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.
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 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 ???
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.
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
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?
There are 5 sellers and their sales are captured in an individual sheet for each one. Also there's a general sheet where all the sales from all the sellers can be seen.
Now, each seller receives a commission of 5% for each sale he makes. However, when the sum of all the sales of all the sellers is greater than a predetermined goal (let's say 1000 USD), the commissions change to 7% instead of 5%.
IMPORTANT: The seller only receives 7% of commission from the sales made AFTER the goal was reached, the ones before are paid at 5%.
So I need to be able to split the sales in the end to know which were made before and after the goal was reached, so that the commissions are paid correctly.
I have a macro in a file that I want to only be able to run if a certain cell in the worksheet says something in particular. I.e. This macro can only be run on Day 7 of any week. There is a cell on the worksheet that says "Day 7" or whichever day it is. I want to get my macro to run if that cell does say Day 7 and to come up with an error message box if it doesn't.
I have recorded a simple macro that refreshes a set of random data in my sheet everytime I click on the button I made. When I see a zero in one of the cells I know to stop refreshing. The thing is, I click on the button quite rapidly and sometimes miss the zero. I need to click on this button quite quickly so slowing down isnt an option! What I need is for excel to stop that button operation when it sees a zero in one of the cells.
I have a spreadsheet that I need to cut and paste data from one tab to another but only from columns B:K (as the spreadsheet has formulas that can not be alterred after column K. It must also paste that data for the hidden columns.
The condition on the data to be pasted in based on the tabs along the bottom.
So for example, anything that says Corn Products needs to be cut from the "standard customers" tab and moved to the Corn Products tab, and so on for the additional tabs. I then need to un-check (hide) Blanks from the filter on the Standard Customers tab.
If possible, I would like run the Subtotals function in this same macro; the conditions for that are as follows
For each change in Shipper, Subtotal Billing for <<month>> (Column S) Page break inbetween each Change in Shipper, then I would also like each subtotal figure bolded.
Also, this is something I must do every month, and each customer may have more or less lines or no lines at all in any particular month.
Currenty i am designing accounting related excel design. In that i need one macro for entering the value in a table based on some condition. I explaine the concept behind this, could some one able to help mean please share the information
I have a xls worbook with two sheets. in the first sheet contain the column for entering the values. in the second sheet having one small table withdate and Numbers.
i need to enter the values in the first sheet S.NO, Date and Value. when i enter the value in the first sheet, the date and S.No is compared to the second sheet table Date and the S.No and the value should be placed in the appropriate cell.
What I need is a macro to delete a row or rows for a specific range of cells (eg. E20 to E58) when the cells in that range column E is = blank. The cells in column E is formated with a currency sign $. Deleting the row should shift up all rows below. I need to run this macro manually. Excel 2002 SP3.
How to create a macro that would highlight a row that has the following condition :
In this table, i need a macro that would highlight the row that has alice data due to it been having 1 ref number count under the ref num column. The macro should loop and end with msg " there are 'x' records having 1 ref number count"