I'm struggling with the next problem.
In excel a put a number in Cel A1: 10
next I created a simple userform with only one button.
I've also created a classmodule named: Retreivedata
The click procedure (for the userform) reads:
Dim dataretreival As New retreivedata
Public number As Double
Sub CommandButton1_Click()
number = 999
MsgBox number
dataretreival.getdata
MsgBox number ' msgbox answers with 999, but i would like this to be 10
End Sub
The code for getdata (for the class dataretreival) reads:
Sub getdata()
number = Range("a1").Value 'this value is 10, from the workbook cel A1
MsgBox number msgbox answers with "blank, nothing" but i would like this to be 10
End Sub
How can I solve this small problem, what am I doiing wrong.
Please help
In excel a put a number in Cel A1: 10
next I created a simple userform with only one button.
I've also created a classmodule named: Retreivedata
The click procedure (for the userform) reads:
Dim dataretreival As New retreivedata
Public number As Double
Sub CommandButton1_Click()
number = 999
MsgBox number
dataretreival.getdata
MsgBox number ' msgbox answers with 999, but i would like this to be 10
End Sub
The code for getdata (for the class dataretreival) reads:
Sub getdata()
number = Range("a1").Value 'this value is 10, from the workbook cel A1
MsgBox number msgbox answers with "blank, nothing" but i would like this to be 10
End Sub
How can I solve this small problem, what am I doiing wrong.
Please help