Dear All,
I would like to get some feedback how to write my desired module.
]I have a file in which column "O2:O50" is changing as new data is collected from an external source (Bloomberg). The same applies for "AD2:AD50" and "AS2:AS50". Now I would like to get a message if one of the values within these ranges is larger than the product of two cells who are always the same $A$1 and $A$2. In addition, I have multiple sheets, so I would like to make sure that the module applies for every sheet.
But how do I make sure that the messagebox gives me the correct message? So the right range (of the three ranges) that satisfies the criteria? Ideally, I would like to get a message to say:
"In "...", the following option serie "..." satisfies the criteria as the volume, "..." has changed
where the first "..." represents the name of the sheet
the second "..." represents the cell 3 columns to the left of the cell in the range (that satisfies the criteria)
the third "..." is the value in the cell in the range (that satisfies the criteria)
Help is very much appreciated.
I would like to get some feedback how to write my desired module.
]I have a file in which column "O2:O50" is changing as new data is collected from an external source (Bloomberg). The same applies for "AD2:AD50" and "AS2:AS50". Now I would like to get a message if one of the values within these ranges is larger than the product of two cells who are always the same $A$1 and $A$2. In addition, I have multiple sheets, so I would like to make sure that the module applies for every sheet.
Code:
Sub Scanner()
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
With Sh
If Range("O1:O50") or Range("AD2:AD50") or Range("AD2:AD50") > 0.1 * $B$3 * $B$5 Then
Msgbox
But how do I make sure that the messagebox gives me the correct message? So the right range (of the three ranges) that satisfies the criteria? Ideally, I would like to get a message to say:
"In "...", the following option serie "..." satisfies the criteria as the volume, "..." has changed
where the first "..." represents the name of the sheet
the second "..." represents the cell 3 columns to the left of the cell in the range (that satisfies the criteria)
the third "..." is the value in the cell in the range (that satisfies the criteria)
Help is very much appreciated.