Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Member
 
Location: Birmingham
Posts: 35
Default Userform to update rows of data

Hi all, new to the use of user forms but using guides available online I've managed to create one that allows for data to be added to a worksheet.

What I also need is the ability to edit the data using either the same or a different user form. Textbox2 is a unique ID that when recalled, I would like the user form to find the matching data in the table and allow to be overwritten.


Any help would be greatly appreciated - code for my existing userform below.

Many thanks in advance.




Private Sub Label1_Click()

End Sub

Private Sub Label11_Click()

End Sub

Private Sub Label2_Click()

End Sub

Private Sub TextBox5_Change()

End Sub

Private Sub UserForm_Click()

End Sub
Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet1.Range("b65536").End(xlUp)

LastRow.Offset(10, 0).Value = TextBox1.Text
LastRow.Offset(10, 1).Value = TextBox2.Text
LastRow.Offset(10, 2).Value = TextBox3.Text
LastRow.Offset(10, 3).Value = TextBox4.Text
LastRow.Offset(10, 4).Value = TextBox5.Text
LastRow.Offset(10, 7).Value = TextBox6.Text
LastRow.Offset(10, 8).Value = TextBox7.Text
LastRow.Offset(10, 9).Value = TextBox8.Text
LastRow.Offset(10, 10).Value = TextBox9.Text
LastRow.Offset(10, 11).Value = TextBox10.Text
LastRow.Offset(10, 12).Value = TextBox11.Text
LastRow.Offset(10, 5).Value = TextBox12.Text
LastRow.Offset(10, 6).Value = TextBox13.Text

MsgBox "Variation details added"

response = MsgBox("Do you want to add another Variation?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""

TextBox1.SetFocus

Else
Unload Me
End If

End Sub
Private Sub CommandButton2_Click()
End
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default Userform to update rows of data

Did you consider using Excel's built-in DataForm for doing this? It
does exactly what you want and requires no code!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Member
 
Location: Birmingham
Posts: 35
Default

Quote:
Originally Posted by GS[_2_] View Post
Did you consider using Excel's built-in DataForm for doing this? It
does exactly what you want and requires no code!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
Hi, Thanks for your reply. Yes I've been using the built in form until this point however it doesn't allow use of combo boxes and the like. Due to the nature of what this would be used for I cannot allow room for typos from the end users.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default Userform to update rows of data

'GS[_2_ Wrote:
;1612662']Did you consider using Excel's built-in DataForm for doing
this? It
does exactly what you want and requires no code!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Hi, Thanks for your reply. Yes I've been using the built in form
until this point however it doesn't allow use of combo boxes and the
like. Due to the nature of what this would be used for I cannot allow
room for typos from the end users.


I see! So if I understand correctly.., you want users to select IDs
from a combobox and have that ID's data populate the form. If correct
then I have one way that I use in a point-of-sale app that does just
that for adding customer billing info to estimates/invoices. Users can
edit the info on-the-fly before inserting it on the form, and the
option to update the database only is a separate process. This means
users can update customer info whether an estimate/invoice is being
processed or not, ..or both. If this works for you, then post back and
I will provide the code my userform uses so you can modify it for your
scenario.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default Userform to update rows of data

After looking at my POS app I conclude it's probably way too complex
for your needs, and so I'd probably write something much simpler for
you that does the same thing. Please confirm that my understanding of
your needs is correct before I spend the time/energy (I have Lou
Gehrig's)!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Userform to show and update data problem Pierre[_18_] Excel Programming 1 December 8th 07 06:19 PM
Update Data On Sheet From UserForm TextBoxes Minitman[_5_] Excel Programming 3 July 30th 07 02:34 PM
How can I get linked data to update inserted rows Jean-Toledo Excel Discussion (Misc queries) 2 March 30th 07 10:04 PM
Create charts that update automatically from data in rows Brent Charts and Charting in Excel 4 January 19th 06 12:50 PM
Need 2 create userform that uses data from rows...HELP. Adam Excel Programming 2 April 15th 05 08:04 AM


All times are GMT +1. The time now is 07:25 AM.

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

About Us

"It's about Microsoft Excel"