AW: Text anzeigen
14.02.2010 18:52:25
Josef
Hallo Albrecht,
da gibt es mehrere Möglichkeiten, hier eine davon.
' **********************************************************************
' Modul: Modul1 Typ: Allgemeines Modul
' **********************************************************************
Option Explicit
Sub infotext(Optional infotext As String = "")
Dim objShp As Shape
If infotext = "" Then
On Error Resume Next
ActiveSheet.Shapes("+++INFO+++").Delete
Else
Set objShp = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 180#, 63#, 420#, 110#)
With objShp
.Name = "+++INFO+++"
With .TextFrame.Characters
.text = infotext
.Font.Size = 26
.Font.ColorIndex = 5
End With
With .DrawingObject
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.ReadingOrder = xlContext
.Orientation = xlHorizontal
.AutoSize = False
End With
.Fill.ForeColor.SchemeColor = 65
.Fill.Transparency = 0#
.Line.Weight = 3#
.Line.ForeColor.SchemeColor = 12
.Line.BackColor.RGB = RGB(255, 255, 255)
End With
DoEvents
End If
Set objShp = Nothing
End Sub
Sub text()
infotext "Bitte warten...."
'dein Code
infotext
End Sub
Gruß Sepp