Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
job job is offline
external usenet poster
 
Posts: 65
Default Report--anyone???

Does anyone know how to take the value of the little window on the bottom
right of excel (ie you highlight a group of numbers and it shows the sum or
avg or whatever you choose.) and copy it to the clipboard?

Cheers!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Report--anyone???

"Job" wrote in message
...
: Does anyone know how to take the value of the little window on the bottom
: right of excel (ie you highlight a group of numbers and it shows the sum
or
: avg or whatever you choose.) and copy it to the clipboard?
:
: Cheers!

This should do the trick

Sub Macro1()
Dim MyData As DataObject
Set MyData = New DataObject

MyData.SetText WorksheetFunction.Sum(Selection)
MyData.PutInClipboard

End Sub

In order to run since MyData is earlybind, you must go to tools reference in
the VBA editor and select Microsoft Forms 2.0 Object Library. Or you can
change to late bind (i.e. use CreateObject)

Just assign the macro to a button or keyboard shortcut and good to go. Note
you can also change the WorksheetFunction from .Sum to any valid function
(i.e. .Average etc.)

Paul D


  #3   Report Post  
Posted to microsoft.public.excel.programming
job job is offline
external usenet poster
 
Posts: 65
Default Report--anyone???

Thanks Paul! Exactly what I was looking for...
"PaulD" <nospam wrote in message
...
"Job" wrote in message
...
: Does anyone know how to take the value of the little window on the
bottom
: right of excel (ie you highlight a group of numbers and it shows the sum
or
: avg or whatever you choose.) and copy it to the clipboard?
:
: Cheers!

This should do the trick

Sub Macro1()
Dim MyData As DataObject
Set MyData = New DataObject

MyData.SetText WorksheetFunction.Sum(Selection)
MyData.PutInClipboard

End Sub

In order to run since MyData is earlybind, you must go to tools reference
in
the VBA editor and select Microsoft Forms 2.0 Object Library. Or you can
change to late bind (i.e. use CreateObject)

Just assign the macro to a button or keyboard shortcut and good to go.
Note
you can also change the WorksheetFunction from .Sum to any valid function
(i.e. .Average etc.)

Paul D




  #4   Report Post  
Posted to microsoft.public.excel.programming
job job is offline
external usenet poster
 
Posts: 65
Default Report--anyone???

I noticed something..if you have an autofilter on, this sub still takes the
value of every cell, not just the visible ones...is it possible to change is
so that it only looks at visible cells?


"PaulD" <nospam wrote in message
...
"Job" wrote in message
...
: Does anyone know how to take the value of the little window on the
bottom
: right of excel (ie you highlight a group of numbers and it shows the sum
or
: avg or whatever you choose.) and copy it to the clipboard?
:
: Cheers!

This should do the trick

Sub Macro1()
Dim MyData As DataObject
Set MyData = New DataObject

MyData.SetText WorksheetFunction.Sum(Selection)
MyData.PutInClipboard

End Sub

In order to run since MyData is earlybind, you must go to tools reference
in
the VBA editor and select Microsoft Forms 2.0 Object Library. Or you can
change to late bind (i.e. use CreateObject)

Just assign the macro to a button or keyboard shortcut and good to go.
Note
you can also change the WorksheetFunction from .Sum to any valid function
(i.e. .Average etc.)

Paul D




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Report--anyone???

Job, using PaulD's example, this should work:

Sub Macro1()
Dim MyData As DataObject
Set MyData = New DataObject

MyData.SetText
WorksheetFunction.Sum(Selection.SpecialCells(xlCel lTypeVisible))
MyData.PutInClipboard

End Sub

HTH--Lonnie M.



  #6   Report Post  
Posted to microsoft.public.excel.programming
job job is offline
external usenet poster
 
Posts: 65
Default Report--anyone???

Thanks Lonnie

"Lonnie M." wrote in message
oups.com...
Job, using PaulD's example, this should work:

Sub Macro1()
Dim MyData As DataObject
Set MyData = New DataObject

MyData.SetText
WorksheetFunction.Sum(Selection.SpecialCells(xlCel lTypeVisible))
MyData.PutInClipboard

End Sub

HTH--Lonnie M.



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
Getting missing data from one report into another report... vlookupabyss Excel Discussion (Misc queries) 3 January 8th 08 03:26 PM
Print Report W/Sub Report Roger Excel Discussion (Misc queries) 0 September 6th 06 10:53 PM
Automate Excel report to place certain data into existing report? Craig Harrison Excel Worksheet Functions 3 July 25th 06 01:54 PM
Header in Report Manager Report Steve K Excel Discussion (Misc queries) 0 March 7th 06 07:32 PM
=(IF(ISTEXT('Data Report'!$L2:$L4),'Data Report'!N3,J11)) Response s2frost Excel Discussion (Misc queries) 2 June 25th 05 06:07 PM


All times are GMT +1. The time now is 06:53 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"