Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default excel vba userform clear details

hi,
im creating a userform and im wanting to input details ie name etc into
excel cells...i have added a cmd button to exit the form and im wanting a cmd
button to input the details to the cell range BUT continue to keep the form
open to add more names to my list. i cant figure out what code to use to
delete the current information in the form.

*** i dont want to clr the info in excel worksheet just the info in the
userform to add new data

i have so far........
Private Sub cmdInputData_Click()
Range("A1").Select
Selection.End(xlDown).Offset(1, 0).Range("A1").Select
Selection.Value = txtName
Range("A1").Select
Selection.End(xlDown).Offset(0, 1).Range("A1").Select
Selection.Value = txtAmount
End Sub

thanks for your time...
--
"The difference between Possible and Impossible is the measure of ones will"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default excel vba userform clear details

Hello Kelzina,

To keep to form open change the ShowModal property to False.

Then try the code below and remember you'll need to add a Close button (or
some other method) to allow the user to actually close the form.

Private Sub cmdInputData_Click()
Range("A1").Select
Selection.End(xlDown).Offset(1, 0).Range("A1").Select
Selection.Value = txtName
Range("A1").Select
Selection.End(xlDown).Offset(0, 1).Range("A1").Select
Selection.Value = txtAmount
Call ClearFormValues
End Sub

Private Sub ClearFormValues()
With Me
.txtName = ""
.txtAmount = ""
End With
End Sub

Best regards

John


"Kelzina" wrote in message
...
hi,
im creating a userform and im wanting to input details ie name etc into
excel cells...i have added a cmd button to exit the form and im wanting a
cmd
button to input the details to the cell range BUT continue to keep the
form
open to add more names to my list. i cant figure out what code to use to
delete the current information in the form.

*** i dont want to clr the info in excel worksheet just the info in the
userform to add new data

i have so far........
Private Sub cmdInputData_Click()
Range("A1").Select
Selection.End(xlDown).Offset(1, 0).Range("A1").Select
Selection.Value = txtName
Range("A1").Select
Selection.End(xlDown).Offset(0, 1).Range("A1").Select
Selection.Value = txtAmount
End Sub

thanks for your time...
--
"The difference between Possible and Impossible is the measure of ones
will"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default excel vba userform clear details

thank you so much john, really appreciated
:)
kelz
--
"The difference between Possible and Impossible is the measure of ones will"


"John" wrote:

Hello Kelzina,

To keep to form open change the ShowModal property to False.

Then try the code below and remember you'll need to add a Close button (or
some other method) to allow the user to actually close the form.

Private Sub cmdInputData_Click()
Range("A1").Select
Selection.End(xlDown).Offset(1, 0).Range("A1").Select
Selection.Value = txtName
Range("A1").Select
Selection.End(xlDown).Offset(0, 1).Range("A1").Select
Selection.Value = txtAmount
Call ClearFormValues
End Sub

Private Sub ClearFormValues()
With Me
.txtName = ""
.txtAmount = ""
End With
End Sub

Best regards

John


"Kelzina" wrote in message
...
hi,
im creating a userform and im wanting to input details ie name etc into
excel cells...i have added a cmd button to exit the form and im wanting a
cmd
button to input the details to the cell range BUT continue to keep the
form
open to add more names to my list. i cant figure out what code to use to
delete the current information in the form.

*** i dont want to clr the info in excel worksheet just the info in the
userform to add new data

i have so far........
Private Sub cmdInputData_Click()
Range("A1").Select
Selection.End(xlDown).Offset(1, 0).Range("A1").Select
Selection.Value = txtName
Range("A1").Select
Selection.End(xlDown).Offset(0, 1).Range("A1").Select
Selection.Value = txtAmount
End Sub

thanks for your time...
--
"The difference between Possible and Impossible is the measure of ones
will"




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
Copy Filenames AND details to Excel deeds Excel Discussion (Misc queries) 1 December 7th 07 09:25 PM
How do i pull details from a table to appear as a list in excel? GBH99 Excel Programming 4 December 29th 05 10:48 AM
Retrieval of details in excel sheet chits Excel Programming 0 September 4th 05 11:09 AM
UserForm TextBoxes (with ControlSource set) won't clear in one click Paul Martin Excel Programming 2 March 17th 05 11:55 AM
Anyone know how to do an EXCEL Script - details inside tranceplanet Excel Programming 1 December 10th 03 01:00 PM


All times are GMT +1. The time now is 02:53 AM.

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"