Ho scritto il seguente codice,
Worksheets("pag1").Shapes("Text Box 56").Value =
Worksheets("pag2").Shapes("Text Box 56").Value
ma non essendo Value una proprietà dell' oggetto Shapes il debug mi blocca
il codice.
Qualcuno puo aiutarmi ?
Per conoscere i nomi delle TEXT BOX ho registrato una macro dove andavo a
scriverci dentro qualche cosa e poi mi sono letto il codice, c'è un metodo
più veloce ?
Saluti e grazie
-- Ispanico
Forse sarebbe stato più facile utilizzare le TextBox
anzichè le caselle di testo....
Comunque, prova:
Public Sub m()
Dim s As String
Worksheets("pag1").Shapes("Text Box 1").Select
Selection.Characters.Text = s
Worksheets("pag2").Shapes("Text Box 1").Select
Selection.Characters.Text = s
End Sub
Cambia i riferimenti con i tuoi.
--
---------------------------
Mauro Gamberini
http://www.riolab.org/
Ho scritto il seguente codice,
Worksheets("pag1").Shapes("Text Box 56").Value =
Worksheets("pag2").Shapes("Text Box 56").Value
ma non essendo Value una proprietà dell' oggetto Shapes il debug mi blocca
il codice.
Qualcuno puo aiutarmi ?
'-------------------
Prova:
Worksheets("pag1").TextBoxes("Text Box 56").Text = _
Worksheets("pag1").TextBoxes("Text Box 56").Text
'-------------------
Per conoscere i nomi delle TEXT BOX ho registrato una macro
dove andavo a scriverci dentro qualche cosa e poi mi sono letto il
codice, c'è un metodo più veloce ?
'-------------------
Prova qualcosa del genere:
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim TBox As TextBox
Set WB = Workbooks("Pippo.xls") '<<=== da CAMBIARE
For Each SH In WB.Worksheets
For Each TBox In SH.TextBoxes
With TBox
MsgBox SH.Name & ":" _
& vbTab & .Name _
& vbTab & .Text
End With
Next TBox
Next SH
End Sub
'<<=============
---
Regards,
Norman
Dim s As String
Application.ScreenUpdating = False
With Worksheets("pag1")
.Select
.Shapes("Text Box 1").Select
s = Selection.Characters.Text
End With
With Worksheets("pag2")
.Select
.Shapes("Text Box 1").Select
Selection.Characters.Text = s
End With
Application.ScreenUpdating = True
End Sub
Grazie a tutti, ho risolto cosě:
Worksheets("pag1").TextBoxes("Text Box 56").Text =
Worksheets("pag1").TextBoxes("Text Box 56").Text
era proprio quello che cercavo.
Alla prossima.
-- Ispanico