PC Review


Reply
Thread Tools Rate Thread

Automatically show Standard deviation in a selected range

 
 
Mike K
Guest
Posts: n/a
 
      1st Jul 2008
Oh Wise Ones,
I like excel's built-in ability to show the rolling
average, count, etc.. in the status bar as you click and drag. Has anyone
ever extended this ability to add standard deviation to the current options
or via a similar method?

Thanks,
Mike

xp pro v2002 sp2
excel 2003
 
Reply With Quote
 
 
 
 
Gary Brown
Guest
Posts: n/a
 
      1st Jul 2008
Putting Standard Deviation on your Status Bar would involve creating a new
class.

In your 'ThisWorkbook', establish the class with something like...

'set up class for Stats on the Status Bar
Dim clsStatsOnStatusBar As New Class_StatsOnStatusBar

Then create a Class Module.
In the class module, declare the application with...

'/==================================================/
Public WithEvents App_Stats As Application 'App_Stats is a variable
'/==================================================/


Since you are showing info on the Status Bar, you want to make sure to set
the Status Bar back to normal when exiting, so the Class module needs
something like...

'/==================================================/
Private Sub App_Stats_WorkbookBeforeSave(ByVal WB As Workbook, _
ByVal SaveAsUI As Boolean, Cancel As Boolean)
'return statusbar to 'Ready' prior to saving so that you
' can see the 'Saving' progress bar
Application.StatusBar = False
'
End Sub
'/==================================================/


You want to make sure to show up-to-date information when you first go to a
worksheet, so you need something like...


'/==================================================/
Private Sub App_Stats_SheetActivate(ByVal Sh As Object)
Dim rng As Range

On Error Resume Next

Set rng = Selection

If Selection.Cells.Count < 2 Then
Application.StatusBar = False
GoTo exit_Sub
Else
' Call StatsOnStatusBar(Sh, rng)
Call StatsOnStatusBar(rng)
End If

exit_Sub:
If Err.Number <> 0 Then
Application.StatusBar = False
End If
Set rng = Nothing

End Sub
'/==================================================/



You want to make sure to show up-to-date information when you make changes
to a worksheet, so you need something like...

'/==================================================/
Private Sub App_Stats_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)

On Error Resume Next

If Selection.Cells.Count < 2 Then
Application.StatusBar = False
GoTo exit_Sub
Else
' Call StatsOnStatusBar(Sh, Target)
Call StatsOnStatusBar(Target)
End If

exit_Sub:
If Err.Number <> 0 Then
Application.StatusBar = False
End If

End Sub
'/==================================================/


And of course you need the actual information to be put on the Status Bar...

'/==================================================/
Private Sub StatsOnStatusBar(ByVal Target As Range)
Dim strStatusBar As String, strStatus As String

strStatusBar = "My Deviation is: " & Application.WorksheetFunction.StDev
(Selection)
'[don't know if this formula works - untested]

Application.StatusBar = strStatusBar

End Sub
'/==================================================/


Save, get out of Excel and then back in.
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"Mike K" wrote:

> Oh Wise Ones,
> I like excel's built-in ability to show the rolling
> average, count, etc.. in the status bar as you click and drag. Has anyone
> ever extended this ability to add standard deviation to the current options
> or via a similar method?
>
> Thanks,
> Mike
>
> xp pro v2002 sp2
> excel 2003

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Standard Deviation Azkid7k Microsoft Access 3 11th Feb 2009 06:54 PM
standard deviation mikeoutback@hotmail.com Microsoft Excel Charting 3 16th Apr 2008 01:04 AM
standard deviation afdmello Microsoft Excel Discussion 10 15th Mar 2008 12:10 AM
Excel Charts: Can I show standard deviation on selected series? =?Utf-8?B?QnVkIEZpbmE=?= Microsoft Excel Charting 1 13th Feb 2005 05:01 PM
Filling a selected range automatically Neil Microsoft Excel Programming 1 20th Aug 2004 02:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:29 PM.