Not Working-WS Change Macro When Cell Is Updated Via Formula
Sep 12, 2007
I am using the worksheet change routine for conditional formating of more than three items.
The problem is that it only changes if I manually type within the page and does not update if the cells are updated via formulas.
To explain a little more, I have three sheets that I combine into one to help find the best rate from three companies using the following formula:
=IF(AND(MIN(PMI!C4,UG!C4,GE!C4)=PMI!C4,MIN(PMI!C4,UG!C4,GE!C4)=UG!C4,MIN(PMI!C4,UG!C4,GE!C4)=GE!C4),FIXED(PMI!C4,2)&" All",IF(AND(MIN(PMI!C4,UG!C4,GE!C4)=PMI!C4,MIN(PMI!C4,UG!C4,GE!C4)=UG!C4),FIXED(PMI!C4,2)&" PMI/UG",IF(AND(MIN(PMI!C4,UG!C4,GE!C4)=PMI!C4,MIN(PMI!C4,UG!C4,GE!C4)=GE!C4),FIXED(PMI!C4,2)&" PMI/GE",IF(AND(MIN(PMI!C4,UG!C4,UG!C4)=GE!C4,MIN(PMI!C4,UG!C4,GE!C4)=GE!C4),FIXED(UG!C4,2)&" GE/UG",IF(MIN(PMI!C4,UG!C4,GE!C4)=PMI!C4,FIXED(PMI!C4,2)&" PMI",IF(MIN(PMI!C4,UG!C4,GE!C4)=UG!C4,FIXED(UG!C4,2)&" UG",IF(MIN(PMI!C4,UG!C4,GE!C4)=GE!C4,FIXED(GE!C4,2)&" GE","ERROR")))))))
Please feel free to condense this if you like.
So when I update a reference on one of the first three sheets, the cells update on this sheet but the cell colors never change. This is the code for the worksheet change
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cel1 As Range
Dim Rng1 As Range
On Error Resume Next
Set Rng1 = ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas, 1)
On Error GoTo 0
i want to link my stock portfolio to a spreadsheet to make various calculations on historic performance. my problem is that it is the same cell thats get updated whenever a change occurs, so that there is no history.
let's say i put the DDE-link in cell A1, i would like B1 to be filled with that value and then when the value changes i would like B2 to be filled with the new value and the next time B3, and so on.
It is my general understanding that the change event system within Excel vba is fairly particular as to what will fit the mold of a qualifying change event.
For example, changes that the user imparts to the worksheet and other written code are legitament candidates for change events. However copying down data and cells changing their values indirectly rather than directly may not be considered in the Microsoft change event design.
I would like to know 2 things:
1) Does a cell updated by a market data feed mechanism qualify for a change event?
2) Any list of qualifying change event types. It seems that Microsoft does not have this information.
I am running into a problem with a macro. I have the block of code below repeated about 30x in vba. When I went to create a new list box, ie: "List Box 2", in a new sheet it is not working.. The code is the exact same, but it is not working at all.
why my keyboard navigation keys (Tab and arrow keys) quit working after the code below executes? Other keyboard keys like alpha or numeric characters and Enter work but I can't move to another cell without clicking it. Selecting another ws, then returning to the "Master" ws fixes the problem. I tried activating Master near the end of the code but that didn't help. Master is not a protected sheet.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column 7 Or Target.Cells.Count > 1 Then Exit Sub If IsEmpty(Target) Then Exit Sub Dim NextRow As Long, MySheet As Worksheet Set MySheet = Sheets(Target.Value) NextRow = MySheet.Cells(Rows.Count, 1).End(xlUp).Row + 1 With MySheet .Unprotect "1234" Range(Cells(Target.Row, 1), Cells(Target.Row, 6)).Copy .Cells(NextRow, 1) With .Cells(NextRow, 7).......................................................
I have had a TREMENDOUS amount of assistance from a true gentleman, Jaslake; aka John. In an attempt to quite monopolizing his time I wanted to throw this at the board. I have a number of sub sheets with exact ranges of (B4,d4:b44, D44) update an individual cell (H6:H86) in the” summary” page. My attachment explains it in detail but currently I will show you the formula that resides in (H6) of "Summary". (H6) = Sheet "1". This formula only covers (B4,D4:B10,D10) for example purposes but I need it to run all the way through (B4,d4:b44, D44) for all 80 sheets.
March 01, 2009-Today looks good | March 02, 2009-Today looks bad|March 03, 2009 - Today we had issues in Boston|March 04, 2009-Issues in Dallas | March 05, 2009-Issues In New York|March 06, 2009 - New York is complete|March 07, 2009 - Dallas is Complete
NOW, with this said what I really would like to happen, if it is possible, is to have the "Summary" (H6) only have the last range that has been updated showing. So if currently B4,D4 is showing in (H6) once the user types into B5,D5 then it replaces B4:D4. I would like this action to repeat itself until the user has completed their event. The reason I can not stick with a formula in (H6:H86) is because I have a macro running a copy.paste, then clear.contents once a selection is made in Column 4. The information must remain on the sub-sheets but it can be replaced in “Summary “. “Summary” is only a quick view of the current status while the sub sheets are a log of all the work done. So, the following
I have a spreadsheet that contains the 5 digit numbers in the rows and the columns respecstively. I'd like a formular or macro to change font color for each cell. If the combined value of the 5 rows are greater or less than the combined range 87030 and 87200, the 5 cells will be changed to Red. If:.........
The loop is putting the correct formula into the cell - but THEN... - I wish to (within the loop and before it moves on) check if the value is equal to OR greater than 1 - if it is, make it a value of 1 (this '1' is then used at the bottom of the column of data to give a total). I need to do this before it moves onto the next cell. What am I doing wrong? Is it because once it puts formula in the cell, it then moves down - do I need to select the cell again first? As I had originally posted on this site - link: url]http://www.excelforum.com/showthread.php?t=641970[/url]
What I have is a database of measurements taken, where X-axis is distance across a surface and Y-axis is measuring deformation to that surface. Each measurement is actually a group of data points from one sweep across the surface on a certain day, resulting in a line plot for that group. What I'm trying to do is create a "checksheet" so that you can overlay plots from multiple dates on the same grid to compare how the surface has changed with each measurement. I've got the checksheet part working properly, and I can toggle things on/off as I like as long as my data doesn't change.
The rub is that this data is gathered via query, and each measurement doesn't have the same # of data points. If I update the query to look at a different date range, the plots are now off because the old data range doesn't match the new data.
Is there any way of changing the data range when a query gets updated, or a way to tie it to a function?
I have a code and I want to run this macro whan a specific cell change (which has sum formula) and this code also has some calculation. And I m not understanding to overcome this problem through Calculate event.
I want a macro in one worksheet to run when any cell (in a given range)on a different worksheet (dataentry) is updated. I have spent along time trying to make it work with no avail. The code I use to start my macro is as follows.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count <> 1 Then Exit Sub
If Target(1, 1).Address = "dataentry!H5:IV72" Then If Not Intersect(Target(1, 1), Range("dataentry!H5:IV72")) Is Nothing Then
On Error Resume Next Application.EnableEvents = False
On one of our computers at work, Excel is acting especially strange. The conditional formatting in Excel on one of our computers is not working. In addition, we cannot fill a cell with any color or change the color of the writing. We can click a color for the letters and type it in, but immediately after another cell is highlighted, the writing goes black again. When we try to highlight multiple cells with the cursor, the cells are black instead of the normal color. This happens to not just spreadsheets that are new, but existing spreadsheets on our shared drive from only this one computer as well. No other computers are affected this way. All other computers show the spreadsheets fine and do not have any functionality issues.
I'm trying to use a formula for column F, starting in cell F6, for column M, starting from M26. The formula works in Column F but after I tried to use it in column M with adjustments, it doesnt work. Attached is the file.
the autosum is not working on one cell which has a formula. All the other cells with formulas are summing correctly. The forumla i used is: =IF(C21="No","-1","") If i enter "No" in C21 the value -1 is return.
However the autosum does not seem to pick up this -1 and only returns 0.
All the answers I can find for this address either the auto-calculation setting or formatting the cell as a number. I am using this same formula in a bunch of cells to calculate totals: =SUM(E12:E17). It works find all over the sheet, except in one box. There is no difference in formatting or data type or anything.
Not working: notworkingexcel.png
The numbers being summed from the cells above the one in question are referenced from another sheet if that is relevant.
I am currently working on a data analysis project (data mining) and need to collect and later analyze statistics for the inputs which control a series of calculations. These statistics are shown in the Statistics 1, Statistics 2 and Statistics 3 cells in the workbook that I attached. The inputs are X,Y; all possible values for these inputs are listed in the N,O columns. Basically I need a macro which would take the values from these two columns and place them pair after pair into the controlling cells (K3, L3), then it would copy cells H2 through L3 (updated stats) to a new sheet after each copy operation - so that I will finally have a list of statistics for all of the input pairs.
I had a working macro before i added an extra row for another entry (No. of Hours spent). The entire data collection calculates the total price of a project (called PSR) in another cell underneath. The macro is suppose to move the entire data into another sheet to keep a history (in Sheet2). I've attached the file containing the workbook.
I have code which when run thru manually in VBA says it has updated the contents of the cell in a sheet. Indeed the code all reacts as if it has updated the cell in memory, however the actual spreadsheet cell has not been updated. This has happened in the past and then magically starts working wthout change.
Is it possible to set something up on a spreadsheet which shows who last updated a cell and when they did it? I have a huge spreadhseet with lots of data on which gets updated by a number of users, they update a lot of different cells and this leads to errors being made with the data in the spreadsheet.
is a way I can show who updated a cell and what date - is this doable?