I receive real time data ( Last Trade Price ) of soybean commodity futures through DDE in to excel ( cell A1 ). During market hours A1 will keep updating every milliseconds or seconds.
My cell B1 ( =A1 ) will have same value as A1 and will update at the same time.
What I'm looking for - A macro code so Whenever value in B1 is between 9.5000 and 9.5050, I want run a subroutine ( similar to calling a macro ). Since B1 would change dynamically so everytime B1 comes between range 9.5000 and 9.5050 a subroutine is fired.
I'm planning to CALL following subroutine -
Sub BuyBeanst()
Range("N9").Activate
ActiveCell.Value = "Y"
Range("T10").Activate
ActiveCell.Value = "Y"
Range("T11").Activate
ActiveCell.Value = "Y"
End Sub
I am aware that I can use single changing events in worksheet change events. For instance, if column 1, or A is changed, do something. This is only a single If statement, i.e. either the condition is true, or not. What I am not sure is if I can use two changing events, i.e. two conditions. For e.g. I would like if Column A value is X and Column B is "Active", action it, but only if two conditions are true.
For.e,g. The below syntax does not work. If it is only column A, it does work, but I want both A and B to be true, then copy and paste the target does not anything.
VB: If Target.Column = 1 Then If Target.Column = 2 Then If Not Intersect(Target, Range("A2:A" & Rows.Count)) Is Nothing Then If Not Intersect(Target, Range("B2:B" & Rows.Count)) Is Nothing Then If Target.Value = "X" And Target.Value = "Active" Then
I have a worksheet with three columns in it. the first column is the "channel column", the second column is the "status column"; which indicates the status of the channel column wheter it is active or not, the third column is the "circuit name" column which indicates the circuit name for each channel. now, the status of the channel depends on the value of the circuit name column.. if the cell in the circuit name column is blank, the status column has an if formula that automatically changes it to vacant status, otherwise active.
i added command buttons namely "active" and "vacant". this buttons correspons to active userform and vacant useform when clicked. in each userform there is a combobox. My problem is how would i fill the combobox in the active userform with the active channels only , and same in the vacant userform with vacant channels only. the comboboxes list should correspond to changes in the status column, that is if one channel gets an active status it would be deleted from the vacant userform and be added to the active userform
I have set up a selection change routine which works if the cell has previously been used or if you make an entry and then change it again. I have tried to delete the empty cells 1st and then save the document, when opening the document it I enter a value in a previosly unused cell the change function does not appear to be called. There is an auto open routine that runs as well, there is more code in use but it fails at the start point.
I have set of data in multiple range ,need to fill the and replace the old values depends upon two column values (AH & AL)
IF Active Calls is "TATA" In AH:AH, and IF Action Onwer Col is "Blank",in AL:AL Then Fill the Blank cells by Values "SVC" in the col Action Owner,Then Replace Old values by "Updates Awaited" in Status Col(AM:AM)
Find the attachment & basic code take this code for this task
I have set of user-form contains with Combox & 2 textbox and to generate report one cmd button
I have 3 different sheet contains report of daily activities ( Dispatch,Closed,Cancel)
If Dispatchcalls Select In Combobox1 ,Then Filter Start And End Date In Two Textboxes Then Click Cmd" Export Data To Excel"Extract Data from dispatchcalls Then Save Data Into Excel File As "Dispatchcalls".
If Closedcalls Select In Combobox1 Then Filter Start And End Date In Two Textboxes Then Click Cmd" Export Data To Excel"Extract Data from Closedcalls Save Data Into Excel File As "Closedcalls".
If Cancelcalls Select In Combobox1 Then Filter Start And End Date In Two Textboxes Then Click Cmd" Export Data To Excel"Extract Data from Cancelcalls Save Data Into Excel File As "Cancelcalls".
"C:UsersmaniDesktopNew folderLenvo_ReportsONSITE CasesVlokupuf" This is path i stored existing 3 file dispath,closed,cancel
I am analysing data to determine buy or sell transaction signals. The problem is that the method can and does produce frequent signals that are merely confirmation rather than new information.
Therefore, I need to select a signal, eg a "buy" signal where the previous transaction signal was the opposite, eg a "sell" signal.
In the attached sheet N10 is a valid signal as the previous signal was a "sell" signal. However, N14 is not valid as the previous signal was also a "buy" signal.
Currently, I am using a simple formulae to determine the signals, e.g. =IF(J26>0,J26,0). Hoevever, I need to modify this by looking back to confirm that a value >0 occurred first in column K rather than column J. If the value >0 occurred first in column J then I need to ignore the buy signal.
I am not sure if the formulae can be modified or if a macro is needed.
In both instances I want to put a date stamp of the column immediately after the defined columns below.
The first issue is that when it runs the 1st change event, it only puts the date stamp in the top row of the column. The change in the "Inportedshapeall" column would almost always be brought about from range being copied from another column, however, I would still like a date stamp in every cell of the column.
The second issue comes about when I try to run the second change event. It simply seems to get stuck. I have tried Else, Else if, removing End ifs. I am not sure how best to define the events in order to ensure it loops through both.
VB: Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("IMPORTEDSHAPEALL")) Is Nothing Then With Target(1, 2)
2 Woksheet Change Events? I have a question similar to one that was posted about 2 worksheet change events which I found out is not possible and so I have to merge the codes together and I don't know how. I'm facing a problem in the advanced filter when I remove the last item to be filtered and takes forever to calculate.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count > 1 Then Exit Sub If Target.Address = "$F$2" Or _ Target.Address = "$F$3" Or _ Target.Address = "$F$4" Or _ Target.Address = "$F$5" Or _ Target.Address = "$F$6" Or _ Target.Address = "$F$7" Or _ Target.Address = "$F$8" Or _ Target.Address = "$F$9" Then Range("Database").AdvancedFilter _ Action:=xlFilterInPlace, _ CriteriaRange:=Range("Criteria"), Unique:=False Exit Sub End If If Target.Column = 3 Then If Target.Value = "YES" Then........................
I am trying to have multiple change events work in one worksheet and can not get it to work at all.
The simple setup is, I have a column for each month of the year.
I have several rows of numbers beneath each monthly column.
What I want to do is if I enter a date in say January (my change field), I want it to "ClearContents" out all of the data in the August column.
This works fine currently.
But say the next month I enter a date in February, I want to "ClearContents" in the September column. And so on for each month.
My various attempts at this does not recognize the second change agent, so nothing occurs.
Should I try to "call" each section, or use "Else If", or some other idea?
I've tried attaching the worksheet in case that helps to see what I am attempting.
There are extra "items" on the side and below the table that will be removed if I get this "change event" working. So this worksheet is a rough draft so far.
I realize that it’s not possible to have on one sheet, multiple Worksheet Change Events, so I tried to come up with an alternative method of handling it, but quickly realized that it’s beyond my capabilities at this time.
I would like to set up a worksheet change event on each of a number of identical sheets. Each Change Event will run exactly the same macro. The exception is the “DeptStr” string value that is relevant to the sheet calling the macro .
Each sheet will be a different department.•If the Target in either range has data added, then data will be added to the cell offset one column to it’s right. •If the Target in either range has data cleared, then data will be cleared in the cell offset one column to it’s right.
•There can only be one sheet active at a time. •Only one sheet has data entered at a time. •The two non-contiguous ranges are of equal length. Ex. (C3:C52) and (E3:E52) and are uniquely named in this case,
but they are not a necessary requirement in order to solve this problem if there is a more practical method.
If a cell in some parts of the worksheet (SSMa,SSDi,SSWo,SSDo,SSVr,SSZa,SSZo in the code) are selected the input (4 digits) should be converted into time (00:00). Cells in some other parts (Util,Assis) require 6 digits and should be converted into time (00:00:00).
I had the code working in seperate worksheets but combined (as is shown in code bellow) only part of it works.
Only the input entered into the 4 digit part (SSMa,SSDi,SSWo,SSDo,SSVr,SSZa,SSZo) is converted correctly.
The input in the other parts (Util,Assis) is not converted (so when 800 is entered I do not get 00:08:00 but I get the hour equivalent of 8 days (19200:00:00) and logically the message from the EndMacro "You did not enter a valid time". The cell formats are correct [u]:mm and [u]:mm:ss.
To me it looks like it does not jump to the 6 digits part when need but I can't figure why.
Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim TimeStr As String
On Error GoTo EndMacro
If Application.Intersect(Target, Range("SSMa,SSDi,SSWo,SSDo,SSVr,SSZa,SSZo,Util,Assis")) Is Nothing Then Exit Sub End If If Target.Cells.Count > 1 Then..........................
I have a worksheet that I would like to color a range of cell within a row whenever the value of a certain cell in that row changes. For example, if cell A3 have a value of East that row color will be Blue with white fonts, if value is West the row color will be Green with Black fonts, if value is North the row color will be Red with Yellow fonts. This should apply to any row whenever the value is Column A is changed.
The codes below allows me to change the color of the cells in Col F & G dependence on the value of Col G. I like to add another condition and that is if Col K the value is cancelled or closed the whole row will be CellColor = 48: FontColor = 2
Sub Risk_Color() Dim c As Range, myFontCol As Integer, myCol As Integer For Each c In ActiveSheet.Range("f7:g20000") myFontCol = xlAutomatic myCol = xlNone Select Case c.Value Case Is = 1, 2, 3 myCol = 34....................................
I'm trying to come up with some code that will allow a user to mouse click a cell to cut it, then mouse click another cell to paste it, then it toggles back to mouse click a cell to cut it. It would be a 2 step process for the user - select cut then select paste.
I have a previously working _chnage event that I am now trying to nest a similar event in. Neither event works now. What am I doing wrong?
Private Sub Worksheet_Change(ByVal Target As Range) Dim refrange If Target.Address(0, 0) "C55,G107" Then Exit Sub refrange = [MATCH(C55,lst_AgentType,0)] With Sheets("NewInput").Range("d63:r63") If refrange = 1 Then .NumberFormat = "#,##0" ElseIf refrange = 2 Then .NumberFormat = "#,##0.00" Else .NumberFormat = "0.00%" End If End With If Target.Address(0, 0) = "G107" Then refrange = [MATCH(G107,lstCommRev,0)] With Sheets("NewInput").Range("E107") If refrange = 1 Then .NumberFormat = "#,##0.00" Else .NumberFormat = "0.00%" End If End With End If
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 workbook with several worksheets. One sheet ('Forecast') contains 12 ComboBoxes, which, on a Change event, run a series of macros to show the users certain information and provide certain options: protected 'Budget' or 'Actual' data from a hidden datasheet, or unprotected 'Forecast' cells that respond to user changes. In other words, I can't simply use a series of 'If' statements or VLookups with conditional formatting to get around the ComboBoxes.
OK - So in ordinary use, the ComboBoxes and macros are working as intended. But there is one situation that causes problems:
When a SaveAs command is used to save the model under a different name, all 12 ComboBox Change Events are somehow being triggered.
So what is it about a SaveAs command that triggers ComboBox Change events?! And whatever it is, can I turn it off?
(This happens in Excel versions 2000, 2003 and 2007.)
I would like to create a macro for my boss, their requirement is, in sheet 1 , they have one column, To chase . So when type "y" in any of the cell in a 'To chase' column, then copy the entire row and paste to sheet2.
Also is it possible to do this any selection change event of the cell?
I have a yearly running log (attached). At the bottom in cell [B88] I would like to develop a formula that gives me the number of times I ran in that specific month. Dates are in Column A and running distances are in Column B. If a distance is zero, I don't want to count it. I have attempted to solve this using the =COUNTIFS formula, but I am not able to structure it properly. Maybe =COUNTIFS is not what I should be using.
In cell A1, I have the month number (eg, 1, 2, 3,). The month number reflects current month and will automatically change with every month. For example, right now it’s 6, next month it will automatically change to 7. Each two columns in Range A10:X20 represents the data from January to December. I want to use a worksheet event to change the background of the current month two columns in the range to yellow color and the two columns in the range will be visible when I activate this sheet.
Cells B3 and B6 both have lists created through data validation.
If the value in B3 changes (by user selecting from the list), I'd like B6 to automatically change to "Select a take to retrieve" (which is the first choice in the B6 list.)
Likewise, if the value in B6 changes (by user selecting from the list), I'd like B3 to automatically change to "Select a version to take" (which is the first choice in the B3 list.)
I need to write a condition in such a way that cell IF A1= "DBR","BPR","SLR","SKR" then change cell B1 to SPECIFIC COLOUR Each condition different colour. A1 values ("DBR","BPR","SLR","SKR") is a list of selectable values. if the condition is falls then B1 should be normal (white color cell) with 0 in it.
In column A I have a unique number. In Columns B,C,D,E F and G I have various data
What I would like is to select a Number from Column A and the Row that contains that number Columns B,C,D,E F and G I want to change these Cell Value to 0
For example
Unique number in Column A is 1052 This appears in Cell A452 The cells Values of B452,C452.D452,E452 Etc to G452 change to 0
I created a multipage spreadsheet to track stocks. Two pages import quotes from Microsoft automatically about every 10 minutes. The main page organizes these stock quotes next to the symbols. Stock price, $ change, then % price change.
For example, for symbol INTC, PRICE cell is =Quotes!D120. $ change is =Quotes!J120 % change is =Quotes!I120
Now all of a sudden, during a random refresh, EXCEL IS CHANGING THE VALUES from D120 to AB120. J120 to AG120. I120 to AH120. That was after fixing it earlier today. Earlier today it randomly changed those values to something else. Like A, T, and V substitutes for the proper fields. This is happening to about 10 stocks in a row, but I think I saw it on a couple others earlier. It is as if someone is changing these fields (but they aren't!) The fields on the pages being pulled from are staying the same.
Using Office (Excel) XP on a Windows 7 PRO 64-bit OS.
I would like to have the cell color changed according to what value is chosen from a drop down menu. I guess you need to make some kind of rule with conditional formatting ...