FaheemAhmadGul
asked on
VBA Function that can Convert a String to an Integer
In a VBA project I have Sub that takes an Integer as an argument.
Where I call this function I intend to get the value of a this parameter from the Tag of a button (within the Click Event of which I will call my Sub that takes an integer as a Parameter).
End Sub
Where I call this function I intend to get the value of a this parameter from the Tag of a button (within the Click Event of which I will call my Sub that takes an integer as a Parameter).
Dim myInteger As Integer
Private Sub cmdButton1_Click()
myInteger = Me.ActiveControl.Tag
‘However the above line does not work because the Tag Property of cmdButton1 is a String
‘ I am looking for a function that will convert a String to an Int so that I can convert the String stored in the Tag of cmdButton
‘ to an Integer so that it can be put into myInteger.
‘ Later in my Code I can the pass myIntegar to my other Sub that takes an Integer as a Parameter.
Call MySubWhichNeedsAnInteger( myInteger)
End Sub
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You’re welcome and I’m glad I was able to help.
If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.
Marty - Microsoft MVP 2009 to 2017
Experts Exchange Most Valuable Expert (MVE) 2015, 2017
Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.
Marty - Microsoft MVP 2009 to 2017
Experts Exchange Most Valuable Expert (MVE) 2015, 2017
Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
ASKER