Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Easy one- Comman button close

What is the code to get a command button to populate a
field and then close the form when the user clicks the
button once?

So far the code I have is:

Private Sub CommandButton1_Click()
Worksheets("Sheet1").Range("C4").Value = TextBox1.Text

End Sub

What am I missing please?

Thanks,
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default Easy one- Comman button close

Hi David

Private Sub CommandButton1_Click()
Worksheets("Sheet1").Range("C4").Value = TextBox1.Text
Unload Me
End Sub

--
XL2002
Regards

William



"David" wrote in message
...
| What is the code to get a command button to populate a
| field and then close the form when the user clicks the
| button once?
|
| So far the code I have is:
|
| Private Sub CommandButton1_Click()
| Worksheets("Sheet1").Range("C4").Value = TextBox1.Text
|
| End Sub
|
| What am I missing please?
|
| Thanks,
| David


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Easy one- Comman button close

Add one line:

Private Sub CommandButton1_Click()
Worksheets("Sheet1").Range("C4").Value = TextBox1.Text
Unload Me
End Sub



--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Easy one- Comman button close

Hi David

Worksheets("Sheet1").Range("C4").Value = TextBox1.Text
Unload Me


--
Regards Ron de Bruin
http://www.rondebruin.nl


"David" wrote in message ...
What is the code to get a command button to populate a
field and then close the form when the user clicks the
button once?

So far the code I have is:

Private Sub CommandButton1_Click()
Worksheets("Sheet1").Range("C4").Value = TextBox1.Text

End Sub

What am I missing please?

Thanks,
David



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comman Button Brenda New Users to Excel 6 October 14th 08 05:33 AM
Comman Button to Save Worksheet as Workbook tmstreet Excel Discussion (Misc queries) 2 July 17th 06 05:44 PM
Auto filter through the Comman Button irsath Excel Worksheet Functions 2 July 3rd 06 01:04 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
Comman Button to open another application hutchuser007 Excel Programming 2 May 11th 04 12:56 PM


All times are GMT +1. The time now is 05:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"