Pon el siguiente código en los eventos de la hoja.
Option Explicit
Const texto = "Texto por defecto"
'
Private Sub TextBox1_Change()
With TextBox1
If .Value = vbNullString Or .Value = texto Then
Call inicio
Else
.Value = Replace(.Value, texto, "")
End If
End With
End Sub
'
Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Call inicio
End Sub
'
Private Sub TextBox1_GotFocus()
Call inicio
End Sub
'
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Call inicio
End Sub
'
Sub inicio()
With TextBox1
If .Value = vbNullString Or .Value = texto Then
.Text = texto
.SelStart = 0
End If
End With
End Sub
Sigue las Instrucciones para poner el código en los eventos de worksheet
- Abre tu libro de excel
- Para abrir Vba-macros y poder pegar la macro, Presiona Alt + F11
- Del lado izquierdo dice: VBAProject, abajo dale doble click a worksheet(tu hoja)
- En el panel del lado derecho copia la macro