UserForm with Cell Data

P

Phil Hageman

I have a CommandButton bringing up a UserForm. On that
form, I want to display the contents of three cells, and
then display the sum of the other three cells. How do I
do this?
 
T

Tom Ogilvy

private Sub CommandButton1_click()
With userform1
.Textbox1.Value = Range("A1").Text
.Textbox2.Value = Range("A2").Text
.Textbox3.Value = Range("A3").Text
.Textbox3.Value = Application.Sum(Range("A1:A3"))
.Show
End With
end Sub
 
P

Phil Hageman

Thanks, Tom - works fine!
-----Original Message-----
private Sub CommandButton1_click()
With userform1
.Textbox1.Value = Range("A1").Text
.Textbox2.Value = Range("A2").Text
.Textbox3.Value = Range("A3").Text
.Textbox3.Value = Application.Sum(Range("A1:A3"))
.Show
End With
end Sub

--
Regards,
Tom Ogilvy





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top