Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Found a way that suits my purpose as I don't need the formatting:
Sub RangeTextToClipBoard(rng As Range) 'Needs a reference to the Microsoft Forms 2.0 Object Library 'but doesn't need an actual UserForm in the Project '----------------------------------------------------------- Dim i As Long Dim c As Long Dim arr Dim strRange As String Dim oDataObject As DataObject Set oDataObject = New DataObject If rng.Cells.Count = 1 Then strRange = rng Else arr = rng For i = 1 To UBound(arr) For c = 1 To UBound(arr, 2) If c < UBound(arr, 2) Then strRange = strRange & arr(i, c) & vbTab Else If i < UBound(arr) Then strRange = strRange & arr(i, c) & vbCrLf Else strRange = strRange & arr(i, c) End If End If Next Next End If With oDataObject .SetText strRange .PutInClipboard End With End Sub Sub Test() RangeTextToClipBoard Range(Cells(1), Cells(2, 4)) End Sub RBS "RB Smissaert" wrote in message ... Is it possible to put a range on the clipboard, then stop the copied range highlight (the walking ants) without clearing the clipboard? RBS |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
clearing the clipboard | Excel Discussion (Misc queries) | |||
Clearing the clipboard | Excel Programming | |||
clearing the clipboard | Excel Programming | |||
Clearing clipboard | Excel Programming | |||
Clearing clipboard | Excel Programming |