Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I keep getting user defined type not defined when i try to run this... Which are the neccessary libraries which i have to add in my references? I have added the Microsoft VB Extensibility but it does not work.. It always break at " Set TempDO = New DataObject " It's supposed to place my 15 randomly selected cells on the clipboard... how can i modify it to place the results on the worksheet itself? Many thanks..... Code: -------------------- Sub GetRandom() Dim iRows As Integer Dim iCols As Integer Dim iBegRow As Integer Dim iBegCol As Integer Dim J As Integer Dim sCells As String Set TempDO = New DataObject iRows = Selection.Rows.Count iCols = Selection.Columns.Count iBegRow = Selection.Row iBegCol = Selection.Column If iRows < 16 Or iCols 1 Then MsgBox "Too few rows or too many columns" Else Randomize Timer sCells = "" For J = 1 To 15 iWantRow = Int(Rnd() * iRows) + iBegRow sCells = sCells & Cells(iWantRow, iBegCol) & vbCrLf Next J TempDO.SetText sCells TempDO.PutInClipboard End If End Sub -------------------- -- Blur ------------------------------------------------------------------------ Blur's Profile: http://www.excelforum.com/member.php...o&userid=28096 View this thread: http://www.excelforum.com/showthread...hreadid=476058 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"User-defined type not defined" message in Excel | Excel Discussion (Misc queries) | |||
user defined type not defined ?? | Excel Programming | |||
Workspace faux user-defined type not defined | Excel Programming | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
Word.Document - user defined type not defined | Excel Programming |