#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros - copying macros from one computer to another TT Excel Discussion (Misc queries) 18 December 14th 06 03:24 AM
Advanced Conditional Formatting Ideas Needed! (ok, maybe not that advanced...) shadestreet Excel Discussion (Misc queries) 2 July 21st 06 03:04 PM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM
advanced if????? taran Excel Worksheet Functions 5 August 3rd 05 04:38 PM
Advanced use of IF Backdoor Cover Excel Worksheet Functions 6 June 2nd 05 08:47 PM


All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"