View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ker_01 ker_01 is offline
external usenet poster
 
Posts: 395
Default Automate Copy and Paste?

Quin-

Consider something like the following (watch for linewrap).
Change the 3 fixed values to match your worksheet layout. This will really
only work well if all your rows are the same height, but you could add some
code to check row height (and adjust accordingly) if you wanted.

I suggest leaving the number of rows to process at 5 until you adjust the
other 3 values to your liking.

HTH,
Keith

Sub MakeTextBoxes()

NumberOfRowsToProcess= 5
FixedRowHeight = 10
FixedLeftSide = 80
FixedWidth = 50

For MyRow = 1 To 2
ActiveSheet.Range("A" & MyRow).Select
tText = Sheet1.Range("A" & MyRow).Value

'ActiveSheet.Shapes.AddTextbox(orientation, left, top, width, fontsize)
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal,
FixedLeftSide, (FixedRowHeight * MyRow), _
FixedWidth, 10#).Select
Selection.Characters.Text = tText
Next

End Sub

"Quin" wrote:

I am using Microsoft Office Excel 2003 at work and Microsoft Office Excel
2007 at home. Using either one of these programs I need to transfer more (a
lot more) than 1000 short lines of text from the cells into text boxes. Each
line of text is in cells A1 through A1000. All the text boxes are adjacent
to the cells.
To do this with manual cut and paste will take forever. Just wondering if
there is some simple code that would allow me to automate doing a €ścopy€ť with
one mouse click from the cell containing the text ,and paste into the text
box with a second click. (Every other click of the mouse would be a
copy/paste)
Any thoughts on this would be appreciated.

Quin