Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mcasteel
 
Posts: n/a
Default VBA: Update worksheet when txtBox data changes.


Im trying to change a worksheets cell value when an end-user changes the
value of a txtBox on a customized form.

Essentially Im pulling information from an excel file and some of that
information may need to be changed by the end-user.

how to I submit any changes back to the spreadsheet once a end-user
changes a field?

Here is the code for the lookup feature to give you an idea of what Im
working with.
================================================== =
Dim rng As Range

With Worksheets(1)
Set rng = .Columns(6).Find(txtCustSSN.Text)

If Not rng Is Nothing Then
'Populate frmCustLookup with Customer Information
txtLname.text = .Cells(rng.Row, 3).Value
txtFname.text = .Cells(rng.Row, 4).Value
txtMname.text = .Cells(rng.Row, 5).Value

Else: MsgBox "Customer Data Not Found"

End If

End With

End Sub
================================================== ===

So for example we look up Ms. Smiths record (by SSN), and need to
change her last name since she has recently been married.

when the user types: Andersen over top of Smith how do I send that
update back to the worksheet?

I'VE CREATED A COMMAND BUTTON \"CMDUPDATERECORD\" TO SUBMIT THE
CHANGES, BUT IM NOT SURE WHAT CODE TO USE.


Thank you for your advice, I know the solution should be easy, but my
coding is a little rusty.


--
Mcasteel
------------------------------------------------------------------------
Mcasteel's Profile: http://www.excelforum.com/member.php...o&userid=15698
View this thread: http://www.excelforum.com/showthread...hreadid=274237

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Mike,

Why not set the textbox ControlSource property to the worksheet cell, it
will automatically update then.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mcasteel" wrote in message
...

Im trying to change a worksheets cell value when an end-user changes the
value of a txtBox on a customized form.

Essentially Im pulling information from an excel file and some of that
information may need to be changed by the end-user.

how to I submit any changes back to the spreadsheet once a end-user
changes a field?

Here is the code for the lookup feature to give you an idea of what Im
working with.
================================================== =
Dim rng As Range

With Worksheets(1)
Set rng = .Columns(6).Find(txtCustSSN.Text)

If Not rng Is Nothing Then
'Populate frmCustLookup with Customer Information
txtLname.text = .Cells(rng.Row, 3).Value
txtFname.text = .Cells(rng.Row, 4).Value
txtMname.text = .Cells(rng.Row, 5).Value

Else: MsgBox "Customer Data Not Found"

End If

End With

End Sub
================================================== ===

So for example we look up Ms. Smiths record (by SSN), and need to
change her last name since she has recently been married.

when the user types: Andersen over top of Smith how do I send that
update back to the worksheet?

I'VE CREATED A COMMAND BUTTON \"CMDUPDATERECORD\" TO SUBMIT THE
CHANGES, BUT IM NOT SURE WHAT CODE TO USE.


Thank you for your advice, I know the solution should be easy, but my
coding is a little rusty.


--
Mcasteel
------------------------------------------------------------------------
Mcasteel's Profile:

http://www.excelforum.com/member.php...o&userid=15698
View this thread: http://www.excelforum.com/showthread...hreadid=274237



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
how do I make a copy of a worksheet and retain formulas but not data FireBrick Setting up and Configuration of Excel 2 December 29th 04 07:33 PM
Copy data into a NEW worksheet Krefty Excel Discussion (Misc queries) 1 December 22nd 04 01:53 PM
use data on master worksheet for sorting Ken New Users to Excel 1 December 7th 04 03:30 AM
Reference Data in Moved Worksheet tommcbrny Setting up and Configuration of Excel 1 December 1st 04 06:49 PM
Report on data in worksheet? Tobias Gårdner Excel Worksheet Functions 0 October 28th 04 01:45 PM


All times are GMT +1. The time now is 06:21 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"