View Single Post
  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
Miyahn Miyahn is offline
external usenet poster
 
Posts: 9
Default Copy from Excel 2003 status bar

"Will Fleenor" wrote in message
Is there a way to copy the result from the 'Status Bar' in Excel 2003 (other
than a VBA macro) to the clipboard?

If not, is there a publically available, simple macro to do this. I do not
know much VBA but can setup and run macros created by others.


If you want to copy 'AutoCalc' result(equivalent value), try this.

Option Explicit
'
Sub CopyACF()
If TypeName(Selection) < "Range" Then Exit Sub
Dim ACF As Long, Buf As Variant
ACF = AutoCalcFunc
On Error Resume Next
With Application.WorksheetFunction
Select Case ACF
Case 2013: Buf = .Average(Selection)
Case 2014: Buf = .CountA(Selection)
Case 2015: Buf = .Count(Selection)
Case 2016: Buf = .Max(Selection)
Case 2017: Buf = .Min(Selection)
Case 2018: Buf = .Sum(Selection)
End Select
End With
If Err Then Buf = ""
On Error GoTo 0
With CreateObject("htmlfile")
.ParentWindow.ClipBoardData.SetData "Text", CStr(Buf)
End With
End Sub
'
Private Function AutoCalcFunc() As Long
Dim aBtn As CommandBarButton
With Application.CommandBars("AutoCalculate")
For Each aBtn In .Controls
If aBtn.State Then AutoCalcFunc = aBtn.ID: Exit For
Next aBtn
End With
Set aBtn = Nothing
End Function

--
Miyahn
Microsoft MVP for Microsoft Office - Excel(Jan 2004 - Dec 2007)
https://mvp.support.microsoft.com/pr...4-83d372c269b4