title image


Smiley Re: Frage zu einem SHAPE, bzw. Textfeld
Hallo,

'

Option Explicit

Const SHPNAME As String = "Inge_Meisel"

'

Sub prcText()

Dim Text As String, shpTextbox As Shape

Text = InputBox("Bitte den Text eingeben")

If Text = "" Then Exit Sub

Set shpTextbox = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 30, 300, 300, 100)

With shpTextbox

.Name = SHPNAME

.TextFrame.Characters.Text = Text

With .TextFrame.Characters.Font

.Name = "Times New Roman"

.Size = 12

.ColorIndex = xlAutomatic

.Bold = True

End With

.Fill.Visible = msoTrue

.Fill.Solid

.Fill.ForeColor.SchemeColor = 26

.Fill.Transparency = 0#

End With

End Sub

'=======================================

Sub prcLoeschen()

Cells.ClearContents

'cells.clear 'such dir was aus

ActiveSheet.Shapes(SHPNAME).Delete

End Sub

'=======================================

Select und activate ist (fast) nie nötig.

'

Gruß M.I.Nitraum









geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: