Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Copy data from the Status Bar

Can you copy the data from the Status Bar to another cell in the spread
sheet. Example, select SUM on the status bar, select a range of cells, status
bar shows the SUM, can that number be copied?
Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Copy data from the Status Bar

The status bar is just a display based on selection. You can get the same
thing with a helper cell and a little VBA. Let's use cell Z100 as the helper.

Sub qwerty()
Range("Z100").Value = Application.WorksheetFunction.Sum(Selection)
Range("Z100").Copy
End Sub

Select the cells. Run the macro. Go elsewhere. Do a paste.
--
Gary''s Student - gsnu200840


"MCook" wrote:

Can you copy the data from the Status Bar to another cell in the spread
sheet. Example, select SUM on the status bar, select a range of cells, status
bar shows the SUM, can that number be copied?
Thanks,

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Copy data from the Status Bar

I don't think there is away to capture that value directly.

But there is the Autosum function which does the same thing.

Select a bunch of cells and hit the Autosum icon on the Toolbar.

If you wanted the value to go to a specific cell you would use the normal
SUM function or VBA

Sub Sum_Range()
Set rng = Selection
Range("A1").Value = WorksheetFunction.Sum(rng)
End Sub

Assign the macro to a button.


Gord Dibben MS Excel MVP

On Fri, 20 Mar 2009 15:40:03 -0700, MCook
wrote:

Can you copy the data from the Status Bar to another cell in the spread
sheet. Example, select SUM on the status bar, select a range of cells, status
bar shows the SUM, can that number be copied?
Thanks,


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Copy data from the Status Bar

Hi,

You might want a function which returns the equivalent of the Status bar
calculations. In this case you can return any of the 6 calculation.

The following function will calculate the specified result for any selected
range.

Function SBar(T As Integer) As Double
Application.Volatile
With WorksheetFunction
Select Case T
Case 1: SBar = .Sum(Selection)
Case 2: SBar = .Average(Selection)
Case 3: SBar = .Count(Selection)
Case 4: SBar = .CountA(Selection)
Case 5: SBar = .Max(Selection)
Case 6: SBar = .Min(Selection)
Case Else: SBar = "N/A"
End Select
End With
End Function

To add this code to a workbook press Alt+F11 and select your file in the
Project explorer in the top left side of the screen. Choose Insert, Module.
Put the code in the resulting module.

Also add the following code to the thisWorkbook object:

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
ActiveSheet.Calculate
End Sub

In the spreadsheet enter a formula like
=SBar(1)
You will get a circular reference error but ignore it.
--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"MCook" wrote:

Can you copy the data from the Status Bar to another cell in the spread
sheet. Example, select SUM on the status bar, select a range of cells, status
bar shows the SUM, can that number be copied?
Thanks,

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
Status Bar sum value copy to spreadsheet Rudi Excel Discussion (Misc queries) 3 August 16th 08 11:19 AM
reuest formula for auto update status & status date PERANISH Excel Worksheet Functions 5 June 2nd 08 04:26 PM
Copy Status bar macro Bongard Excel Discussion (Misc queries) 1 December 1st 06 10:32 PM
filted data, copy and paste a col. puts data in wrong row how fix chris_fig New Users to Excel 1 October 16th 06 04:26 PM
Retrieve multiple data rows data from a very long list and copy t mathew Excel Discussion (Misc queries) 1 September 13th 06 08:24 PM


All times are GMT +1. The time now is 02:44 AM.

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

About Us

"It's about Microsoft Excel"