Copy from Excel 2003 status bar

W

Will Fleenor

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.

Thanks you for your help.

Will Fleenor
 
B

Bob Phillips

If Excel has control of the statusbar it will return False regardless of
what is there. You can only read something programmatically added.

Application.DisplayStatusBar = True
Application.StatusBar = "Testing..."
MsgBox Application.StatusBar
Application.DisplayStatusBar = False


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
M

Miyahn

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top