VBE313
Well-known Member
- Joined
- Mar 22, 2019
- Messages
- 686
- Office Version
- 365
- Platform
- Windows
I have a macro that I used to input numbers in cells/textboxes in my sheet. however, i am puzzled as to how i would declare my variable instead of "As Double"
How can I add text rather than an integer?
Public Sub ToQuote_Change(control As IRibbonControl, text As String) 'Changes the To: in Quote Sheet
Dim toquote As Double
If ActiveSheet.ScrollArea = "$RE$1:$RO$440" Then
toquote = Val(text)
Application.ScreenUpdating = False
ActiveSheet.unprotect
ActiveSheet.Shapes("To").Select
With Selection
.text = toquote
End With
ActiveSheet.Protect , AllowFormattingColumns:=True
Application.ScreenUpdating = True
Else
MsgBox "You are not in the Financials tab"
End If
myribbon.Invalidate
End Sub
How can I add text rather than an integer?
Public Sub ToQuote_Change(control As IRibbonControl, text As String) 'Changes the To: in Quote Sheet
Dim toquote As Double
If ActiveSheet.ScrollArea = "$RE$1:$RO$440" Then
toquote = Val(text)
Application.ScreenUpdating = False
ActiveSheet.unprotect
ActiveSheet.Shapes("To").Select
With Selection
.text = toquote
End With
ActiveSheet.Protect , AllowFormattingColumns:=True
Application.ScreenUpdating = True
Else
MsgBox "You are not in the Financials tab"
End If
myribbon.Invalidate
End Sub