read / write clipboard VBA

T

ThomasX

I am writing a macro in which I refer to the clipboard. So I asked:
how to save a range of cells to the clipboard to later in the loop
repeatedly retrieve the data from the clipboard.
 
D

Dave Peterson

This is one technique that may help:

Option Explicit
Sub testme()

Dim FromCell As Range
Dim DestCell As Range
Dim iCtr As Long

With ActiveSheet
Set FromCell = .Range("A1")
Set DestCell = .Range("B1")
End With

For iCtr = 1 To 10
FromCell.Copy _
Destination:=DestCell
Set DestCell = DestCell.Offset(1, 0)
Next iCtr

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top