Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Getting missing data from one report into another report... | Excel Discussion (Misc queries) | |||
Print Report W/Sub Report | Excel Discussion (Misc queries) | |||
Automate Excel report to place certain data into existing report? | Excel Worksheet Functions | |||
Header in Report Manager Report | Excel Discussion (Misc queries) | |||
=(IF(ISTEXT('Data Report'!$L2:$L4),'Data Report'!N3,J11)) Response | Excel Discussion (Misc queries) |