View Single Post
  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
teepee
 
Posts: n/a
Default Userform button setting variable from formula


"ShaunM" wrote

I am a bit confused by your request but I think that it as simple as:

Private Sub CommandButton4_Click()
inset = Range("A2").Value
MsgBox ("The value of cell A2 is: " & inset)
End Sub


Thanks Shaun, that's kind of you to respond. I think the problem with your
suggestion might be that the variable is only then available within the
userform itself whereas I need to refer to the variable within other macros.
Do I not need another approach if the variable is to be generally available
elsewhere in the spreadsheet?