How to add a TextBox dynamically whenever the Userform
(Combination Box or Data Validation List) is equal to "Outro (Especificar)"
, using VB
?
I'mlost,I'mnewatmakingmacrosandforms,usingVB
.^^'
IwasdoingwithDataValidation,List.
SubOutro()''OutroMacrocoluna=1linha=1WhileCells(linha,coluna).Value<>""
Application.Visible = False 'torna invisível a aplicação Excel
valorCelula = Format(Cells(linha, coluna).Value, 2)
'If valorCelula <> Cells(linha, coluna).Value Then
' Cells(linha, coluna).Value = valorCelula
'End If
linha = linha + 1
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
Selection.Font.Bold = True
Range("G3").Select
ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=497.25, Top:=36, Width:=66.75, Height:= _
10.5).Select
Wend
End Sub