I trying to paste textbox from sheet1 to sheet2
Function footer()
Application.Volatile True
r = Application.Caller.Address
SheetName = Application.Caller.Parent.Name
Select Case Range("Locale").Value
Case "RU": boxx = Range("company").Value & Range("Locale")
Case "EN": boxx = Range("company").Value & Range("Locale")
End Select
Worksheets("Translations").Shapes(boxx).Copy
MsgBox Worksheets("Translations").Shapes(boxx).TextFrame.Characters.Text
ActiveSheet.Paste
End Function
Msgbox Looks ok but paste function do nothing, i tryed different ways
All not working, just nothing appears in the sheet, whats is wrong?
Although you can't copy and paste a shape, you can add a new shape and copy the text and formatting from the original - for example:
Function footer()
Dim boxx As String
Dim shpTo As Shape
Dim shpFrom As Shape
Application.Volatile True
Select Case Range("Locale").Value
Case "RU": boxx = Range("company").Value & Range("Locale")
Case "EN": boxx = Range("company").Value & Range("Locale")
End Select
Set shpFrom = Worksheets("Translations").Shapes(boxx)
With Application.Caller
Set shpTo = .Worksheet.Shapes.AddShape(shpFrom.AutoShapeType, .Left, .Top, shpFrom.Width, shpFrom.Height)
shpTo.TextFrame.Characters.Text = shpFrom.TextFrame.Characters.Text
End With
shpFrom.PickUp
shpTo.Apply
End Function
Try this copy method
ThisWorkbook.Sheets("Sheet1").Shapes.Range(Array(shpFrom.Name)).Select
Selection.Copy
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.