Thema Datum  Von Nutzer Rating
Antwort
08.01.2018 12:01:18 Bifi85
NotSolved
08.01.2018 14:06:51 Gast48594
NotSolved
09.01.2018 09:41:57 Gast88372
NotSolved
09.01.2018 11:55:59 Gast97473
NotSolved
09.01.2018 14:08:24 Bifi85
NotSolved
09.01.2018 15:29:44 Gast72302
NotSolved
09.01.2018 15:47:31 Bifi85
NotSolved
09.01.2018 16:23:25 Gast82034
NotSolved
09.01.2018 16:26:16 Gast62210
NotSolved
09.01.2018 16:31:17 Gast90667
NotSolved
09.01.2018 17:48:51 Bifi85
NotSolved
09.01.2018 18:12:04 fkw48
NotSolved
09.01.2018 18:49:20 Gast46676
NotSolved
09.01.2018 19:41:11 fransi
NotSolved
10.01.2018 14:29:27 Bifi85
NotSolved
10.01.2018 14:54:28 Gast51699
NotSolved
10.01.2018 15:53:15 fransi
NotSolved
10.01.2018 18:20:55 Gast70276
NotSolved
10.01.2018 00:09:34 Gast54080
NotSolved
10.01.2018 00:43:16 Gast93723
NotSolved
10.01.2018 18:57:10 Gast53107
NotSolved
10.01.2018 19:14:09 Gast64046
NotSolved
11.01.2018 10:03:39 Gast39373
NotSolved
11.01.2018 10:05:08 Bifi85
NotSolved
11.01.2018 15:37:22 Gast85672
NotSolved
11.01.2018 17:54:06 Gast43749
NotSolved
12.01.2018 10:18:59 Bifi85
NotSolved
12.01.2018 10:20:38 Bifi85
NotSolved
Rot Excel: Textfeld kopieren und einfügen (VBA)
12.01.2018 15:51:24 Gast31892
NotSolved
12.01.2018 17:10:29 Bifi85
NotSolved
12.01.2018 18:01:33 Gast68462
NotSolved
12.01.2018 19:17:19 Gast70117
Solved
13.01.2018 12:22:09 Bifi85
NotSolved
07.09.2020 21:48:23 Bifi85
NotSolved
08.09.2020 08:20:50 Bifi85
NotSolved

Ansicht des Beitrags:
Von:
Gast31892
Datum:
12.01.2018 15:51:24
Views:
1155
Rating: Antwort:
  Ja
Thema:
Excel: Textfeld kopieren und einfügen (VBA)

Hallo,

yup, so gehts:

' **********************************************************************
' Modul: Modul4 Typ: Standardmodul
' **********************************************************************
 
Option Explicit
Option Private Module
 
Private Const GC_TAB_NAME As String = "Zubereitung"
 
Public Sub prcRefreshBoxes(ByVal pvstrBoxChoice As String)
Dim objTextBox As Excel.TextBox
Dim avntZubereitung1() As Variant, avntZubereitung2() As Variant
Dim adblLeft(1) As Double, adblTop(1) As Double
Dim ialngIndex As Long, lngCount As Long
avntZubereitung1 = Array("Textfeld 1", "Textfeld 2")
avntZubereitung2 = Array("Textfeld 3", "Textfeld 4")
With Worksheets("Pizza")
    For Each objTextBox In .TextBoxes
       For ialngIndex = 0 To 1
           With objTextBox
                If .Name = avntZubereitung1(ialngIndex) Then
                   lngCount = lngCount + 1
                   adblLeft(ialngIndex) = .Left
                   adblTop(ialngIndex) = .Top
                   Exit For
                End If
           End With
       Next
       If lngCount = 2 Then Exit For
    Next
    If objTextBox Is Nothing Then
      Call MsgBox("TextBoxen mit diesem Namen wurde " & _
         "nicht gefunden...", vbExclamation)
    Else
      Call .TextBoxes(avntZubereitung1).Delete
      If pvstrBoxChoice = GC_TAB_NAME & "1" Then
        Call prcInsertBoxes(pravntBoxNames1:=avntZubereitung1(), _
          pradblLeft:=adblLeft(), pradblTop:=adblTop())
      Else
        Call prcInsertBoxes(pravntBoxNames1:=avntZubereitung1(), _
            pradblLeft:=adblLeft(), pradblTop:=adblTop(), opvavntBoxNames2:=avntZubereitung2())
      End If
      Set objTextBox = Nothing
    End If
End With
End Sub
 
Private Sub prcInsertBoxes(ByRef pravntBoxNames1() As Variant, _
   ByRef pradblLeft() As Double, ByRef pradblTop() As Double, _
   Optional ByVal opvavntBoxNames2 As Variant)
  Dim avntArray() As Variant
  Dim ialngIndex As Long
  If IsMissing(opvavntBoxNames2) Then
     avntArray() = pravntBoxNames1()
  Else
     avntArray() = opvavntBoxNames2
  End If
  Call Worksheets(GC_TAB_NAME).TextBoxes(avntArray()).Copy
  Call Worksheets("Pizza").Paste
  If TypeOf Selection Is Excel.DrawingObjects Then
    With Selection
        For ialngIndex = 0 To 1
             With .Item(ialngIndex + 1)
                 .Left = pradblLeft(ialngIndex)
                 .Top = pradblTop(ialngIndex)
                 .Name = pravntBoxNames1(ialngIndex)
             End With
        Next
    End With
  Else
    Call MsgBox("Auswahl konnte nicht bestimmt werden...", vbExclamation)
  End If
End Sub

Gruß,


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
08.01.2018 12:01:18 Bifi85
NotSolved
08.01.2018 14:06:51 Gast48594
NotSolved
09.01.2018 09:41:57 Gast88372
NotSolved
09.01.2018 11:55:59 Gast97473
NotSolved
09.01.2018 14:08:24 Bifi85
NotSolved
09.01.2018 15:29:44 Gast72302
NotSolved
09.01.2018 15:47:31 Bifi85
NotSolved
09.01.2018 16:23:25 Gast82034
NotSolved
09.01.2018 16:26:16 Gast62210
NotSolved
09.01.2018 16:31:17 Gast90667
NotSolved
09.01.2018 17:48:51 Bifi85
NotSolved
09.01.2018 18:12:04 fkw48
NotSolved
09.01.2018 18:49:20 Gast46676
NotSolved
09.01.2018 19:41:11 fransi
NotSolved
10.01.2018 14:29:27 Bifi85
NotSolved
10.01.2018 14:54:28 Gast51699
NotSolved
10.01.2018 15:53:15 fransi
NotSolved
10.01.2018 18:20:55 Gast70276
NotSolved
10.01.2018 00:09:34 Gast54080
NotSolved
10.01.2018 00:43:16 Gast93723
NotSolved
10.01.2018 18:57:10 Gast53107
NotSolved
10.01.2018 19:14:09 Gast64046
NotSolved
11.01.2018 10:03:39 Gast39373
NotSolved
11.01.2018 10:05:08 Bifi85
NotSolved
11.01.2018 15:37:22 Gast85672
NotSolved
11.01.2018 17:54:06 Gast43749
NotSolved
12.01.2018 10:18:59 Bifi85
NotSolved
12.01.2018 10:20:38 Bifi85
NotSolved
Rot Excel: Textfeld kopieren und einfügen (VBA)
12.01.2018 15:51:24 Gast31892
NotSolved
12.01.2018 17:10:29 Bifi85
NotSolved
12.01.2018 18:01:33 Gast68462
NotSolved
12.01.2018 19:17:19 Gast70117
Solved
13.01.2018 12:22:09 Bifi85
NotSolved
07.09.2020 21:48:23 Bifi85
NotSolved
08.09.2020 08:20:50 Bifi85
NotSolved