Quite new to vba and have been trying to figure out how to use data from my first userform to my second userform.
let's call them userform1 and userform2
So in userform1, user will enter data for a, b, c ,and d. Upon clicking OK, userform2 will open:
Private Sub OK_Click()
l = cdbl(a.value)+cdbl(b.value)
w = cdbl(c.value)+cdbl(d.value)
userform1.hide
userform2.show
End Sub
In userform2, i need the values of a and b (entered by user in userform1) to compute for x and y:
Private Sub OK_Click()
x = cdbl(a.value)+cdbl(d.value)
y = cdbl(b.value)+cdbl(c.value)
End Sub
tried placing a placing a b c d l w x and y in a module and setting in Public but code still doesn't work. Error "object required"
Thanks very much in advance.
x = cdbl(Userform1.a.value)+cdbl(Userform1.d.value)work? - CLR