Formula To Trigger Once Threshold Crossed Then Value Decreases
Jan 27, 2012
Is there a formula or combination of formulas that will return the word "Order" if the values in a column go above a certain threshold then start to decrease?
For example we have a list of data in a column that is imported each hour from an external database. Each new value is copied into the next cell down in column B. If the latest value was to go above, say, 100 is there a way of returning "Order" as soon as one of the subsequent values is lower than the previous one?
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.
In the attached table the fees generated are on a sliding scale and the total is the fee generated within these ranges
I would like a formula in b10 to give me the value based on the total sale figure, i.e. 80.00. I've searched the board and tried some very long "if" statements and "lookup" table but to no avail.
Is there a formula I could use to calculate the desired value, preferable using cell references and not the actual values.
I am trying to find a way to identify the nmber of periods where a particular value is exceeded.
Basically I have daily data on sales for 40 years and I would like to define a level of sales i.e. 23 units per day and a period i.e. 10 days and then output the number of times where the recorded sales level is greater than 23 units per day for 10 or more days.
Ideally I would like it so the sales level and period can be set in reference cells and the formula can adapt to different sales levels and periods.
I have a financial model that returns ratios for various years. I would like to highlight in the summary part of the model those years where the ratio is over a set threshold.
For example:
A B C D ...
1 2013 2014 2015 2016 ...
2 31% 29% 41% 28% ...
3 Max: 30%
4 2 years over Max: 2013, 2015
In the above example, the threshold (Max) is 30% (cell B3), so the value in A4 would be "2 years over Max: 2013, 2015"
I have been able to do it manually by putting together a COUNTIF function along with various IF statements as follows: =COUNTIF(A2:D2,">="&B3)&" years over Max: "&IF(A$2>$B$3,A$1&", ,"")&IF(B$2>$B$3,B$1&", ","")&IF(C$2>$B$3,C$1&", ","")&IF(D$2>$B$3,D$1&", ","")...
I even managed to get rid of the final "," by adding a second "," at the end and replacing the expression ", ," using the SUBSTITUTE function (yes, I am a bit **** when it comes to details).
My problem is that I currently have 16 years of projections and, although the above formula works, it requires manual changes every time I add / remove years.
I know that I can do it easily in VBA but the Excel file is to be shared with others via email and I know that their systems are setup to deactivate macros by default (and I don't want to rely on the user having to manually activate macros).
1 TO 10 25.00 11 TO 50 15.00 51 TO 100 9.00 101 TO 250 5.40
In this there is an area where it is cheaper to buy for example 12 instead of 10 and I am trying to work out a formula to deal with this funny step change down as people buy more.
The user enters data into Column E on Sheet1 and i want my code to display a pop-up box when a cell's value exceeds 500. I've tried the two codes below which i thought would work as Excel didn't highlight any breaks when i wrote the code, but no pop-up box is being generated when values > 500.
ATTEMPT 1:
Private Sub Threshold_Check2(ByVal Target As range) Dim cell As range
For Each cell In ActiveSheet.UsedRange.Columns(5).Cells If cell.Value > 500 Then MsgBox "Value within 15% of Threshold" Next cell End Sub
ATTEMPT 2:
Sub Threshold_Check(ByVal Target As range) Set Target = range("E1:E150") For Each cell In range("E1:E150") If Target.Value > 500# Then MsgBox "Value within 15% of Threshold" End If End Sub
I am preparing a list of calibration items that require yearly calibrated, how can I set the date and prompt me example 1 month ahead when the item is going to due soon.
What I want to achive is the colouring of the cells in columns A-L using the trigger of the "Y" character in colums J-L
So when a Y is put in column J the cells to the left and including column J change to green. Then when a Y is put into column K the cells to the left and including K turn yellow. Finally when a Y is entered in column L the cells to the left and including L turn the lovely shade of Pink. It is possible the process will go from a Y in column J to a Y in column L mising out column K but I don't suppose this will matter.
I used to have it working in office 2003 to a fashion but have not yet got my head around 2010
I have a chart with 2 Y axis. I am attempting to write some code that will update both axis with the same max & min value that is triggered by the combobox selection. The code will update the axis but is not triggered by the combobox selection.
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.
I am having trouble trying to get an MS Access Query to run from MS Excel automatically.
I am trying to create an automated trigger in MS Excel that will automatically run my Access query by the times I specify in my statement.
For example: I need to run a query in Access at 9am, 12 pm and 10pm, that's it, but I believe I need to do it via Excel, I don't want the data returned to Excel, I just want Excel to execute the query at those specific times!
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 am encountering a strange situation with my Excel 2000. I have a public function, in a module in the VBA project associated with my workbook. But I'm not calling it from nowhere inside the code, or from other macros - it is not being referred anywhere in the workbook. Yet, after I make a slight change in code and not save my changes, when I return to the workbook and select a value from any cell with a validation-list (regardless of the sheet where it resides), that particular function is being executed!
I have already use excel web query, and set every 5 minutes auto update web. And here is question , I want to use vba event to trigger when cell's value changed.
Unfortunately,
Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
This code didn't trigger successfully,I think that web query make cells value changed didn't trigger the event.
Is it possible, that while running code that the code can say initiate the click event on a command button on another sheet.
Say that I have a button on Sheet1 called "wkscmd_DisplayDEI"
Behind that button is obviously some code. I want to know is it possible that while some code is running ( code does not reside on the module page for Sheet1 that it can send a pseudo click to the button?
i'm attempting to create a spreadsheet that will enable me to calculate the number of certain materials required to construct new rural fencing. I have 4 different 'types' of fencing each requiring different levels of materials required. For example, a Type 'A' fence, requires 5 'droppers' per 10m span of fencing, whereas a Type B requires only 1, a Type C also requires 5 - but a Type D does not require any.
Here is what I have attempted to generate so far - but is giving errors;
We have a customer rebate in place with various levels of refund based on the quantity purchased during the year. I have used a sumproduct formula to calculate this before.
The customer used to have the following set up -
0-999 - £1.00 per unit rebate. 1000-1999 - £2.00 per unit rebate. 2000-2999 - £3.00 per unit rebate.
So if they bought 2501 units they would get a rebate of (1000*1)+(1000*2)+(501*3). However the customer has trigger points so rather than the above it is now -
0-999 - £1.00 per unit rebate. 1000-1999 - £2.00 per unit rebate. 2000-2999 - £4.00 per unit rebate if 2500 bought.
So now it would look like this - (1000*1)+(1000*2)+(501*4). However if they only bought 2499 units it would be (1000*1)+(1000*2)+(499*2).
I have cut and paste some code provided by members of this great forum to insert a row in a second worksheet at the same row number when one is inserted in the active worksheet. e.g. If I insert a new line at Row 14 in worksheet "admin" I also get a new row at Row 14 in worksheet "report".
Code is as follows:
Private Sub Worksheet_Change(ByVal Target As Range) Set sourcebook = ThisWorkbook Set sourcesheet = sourcebook.Worksheets("admin") Set targetbook = ThisWorkbook Set targetsheet = targetbook.Worksheets("report") myRow = ActiveCell.Row targetsheet.Activate ActiveSheet.Rows(myRow).EntireRow.Insert sourcesheet.Activate End Sub
However, anything I do in worksheet "admin" triggers a new row to be inserted in "report".... If I change text in any cell, or make any changes at all, I get a new row in "report".
Is there a way to restrict this action to only a line insert?
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.