Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I originally wanted to write a macro that would copy the value in the
status bar (sum of your selection or whatever function you have chosen) but since I only use the sum function I thought it would be easier to just use the sum fucntion of selection and copy it to the clipboard. I found this macro and avice from an earlier post. Sub Macro1() '' Keyboard Shortcut: Ctrl+Shift+S Dim MyData As DataObject Set MyData = New DataObject MyData.SetText WorksheetFunction.Sum (Selection.SpecialCells(xlCellTypeVisible)) 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) That being said, when I try to run the macro it gives me the error Compile Error --- User-Defined type not defined. In tools references in VBA I can not find that forms 2.0 object library so I don't know if that is the problem. Any ideas??? Thanks in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro copy and paste = blank worksheet | Excel Discussion (Misc queries) | |||
Copy from WORD to EXCEL using a macro..... | Excel Discussion (Misc queries) | |||
Want macro to select & copy cells from a different worksheet | Excel Discussion (Misc queries) | |||
Recorded Macro to Copy Format | Excel Worksheet Functions | |||
Activate a macro to insert a row and copy the formuals from the rows above to the blank row | Excel Discussion (Misc queries) |