Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
advanced macros
Hi there,
I was just wondering if someone could help me with advanced macros. I am working in excel for departmental budgeting and have currently 8 - 10 budgets set up at any given time for monitoring, but what i would like to do is create a macro that will monitor all of the worksheets at once and prompt me if any of my margins reach 15% or less immediately upon excel startup. I want excel to actually state which worksheet and cell has actually reached this margin. Is this possible? Thanks in advance. -- Michel |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
advanced macros
Hi,
A couple of assumptions:- 1. The worksheet tab name is the budget name. 2. The value of 15% is in a cell somewhere (I've assumed A1) 3. the maximum permissable value is in a cell somewhere (I've assumed b1) Try this:- Private Sub Workbook_Open() maxvalue = Worksheets("Sheet1").Range("b1").Value For Each sh In ThisWorkbook.Worksheets sh.Select If ActiveSheet.Range("A1").Value maxvalue _ And IsNumeric(ActiveSheet.Range("A1").Value) Then MsgBox (ActiveSheet.Name & " is now at " & ActiveSheet.Range("A1").Value) End If Next End Sub Mike "michel" wrote: Hi there, I was just wondering if someone could help me with advanced macros. I am working in excel for departmental budgeting and have currently 8 - 10 budgets set up at any given time for monitoring, but what i would like to do is create a macro that will monitor all of the worksheets at once and prompt me if any of my margins reach 15% or less immediately upon excel startup. I want excel to actually state which worksheet and cell has actually reached this margin. Is this possible? Thanks in advance. -- Michel |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
advanced macros
Hi Mike,
Thank you very much for your quick response. I will try your macro and let you know. Your assumptions are workable. Thanks, -- Michel "Mike H" wrote: Hi, A couple of assumptions:- 1. The worksheet tab name is the budget name. 2. The value of 15% is in a cell somewhere (I've assumed A1) 3. the maximum permissable value is in a cell somewhere (I've assumed b1) Try this:- Private Sub Workbook_Open() maxvalue = Worksheets("Sheet1").Range("b1").Value For Each sh In ThisWorkbook.Worksheets sh.Select If ActiveSheet.Range("A1").Value maxvalue _ And IsNumeric(ActiveSheet.Range("A1").Value) Then MsgBox (ActiveSheet.Name & " is now at " & ActiveSheet.Range("A1").Value) End If Next End Sub Mike "michel" wrote: Hi there, I was just wondering if someone could help me with advanced macros. I am working in excel for departmental budgeting and have currently 8 - 10 budgets set up at any given time for monitoring, but what i would like to do is create a macro that will monitor all of the worksheets at once and prompt me if any of my margins reach 15% or less immediately upon excel startup. I want excel to actually state which worksheet and cell has actually reached this margin. Is this possible? Thanks in advance. -- Michel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macros - copying macros from one computer to another | Excel Discussion (Misc queries) | |||
Advanced Conditional Formatting Ideas Needed! (ok, maybe not that advanced...) | Excel Discussion (Misc queries) | |||
Training: More on how to use macros in Excel: Recording Macros | Excel Worksheet Functions | |||
advanced if????? | Excel Worksheet Functions | |||
Advanced use of IF | Excel Worksheet Functions |