Code-Copy & Paste in Text Boxes

B

Bourbon

Thanks Jon, I am trying to copy and paste the data in columms A,C and
into each text box that was selected in columm E. (by the code yo
described)Thus, data for example from A1,C2 and D1 will be pasted int
the text box appearing in E1. And so on.... So a code that will do tha
for every text box that is in columm E??

This is a part of my code:
ActiveSheet.Shapes.Range(shape_names).Select
Selection.ShapeRange.ZOrder msoBringToFront
ActiveSheet.Shapes.Range(shape_names).Select
ActiveCell.FormulaR1C1 = "11/3/2000"
ActiveSheet.Shapes.Range(shape_names).Select
Selection.Characters.Text = "11/3/2000" & Chr(10) & ""
With Selection.Characters(Start:=1, Length:=10).Font

But it will not recognize the Text in the second to last line and
guess it will do the same for columms C and D.....

Anyone have any ideas as to how to do this?

Thanks
B
 
J

Jon Peltier

Are you still placing these text boxes into a chart? This macro puts a
textbox into the active chart, gets its text from two cells in the
worksheet plus the date, and adjusts some of the characters. Maybe you
can see some hints in it to simplify your task.

Sub AddTextBox()
Dim dLeft As Double, dTop As Double
Dim dWidth As Double, dHeight As Double
dLeft = 150
dTop = 100
dWidth = 35
dHeight = 15
With ActiveChart.TextBoxes.Add(dLeft, dTop, dWidth, dHeight)
.Text = ActiveSheet.Range("A8").Value & _
ActiveSheet.Range("B8").Value & vbCrLf & _
Format(Now, "yy_mm_dd")
With .Characters(Start:=4, Length:=3).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
End With
.AutoSize = True
End With
End Sub

- Jon
 

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