LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Save changes command

I use the following code to search for a value in a
column and then display the field values in text boxes on
the form and it works great. Now I need a command to
save the changes made to the field values in the text
boxes back to those specific fields.

Private Sub cmdSearch_Click()
Dim rng As Range
With Worksheets("Sheet1").Columns(1)
Set rng = .Find(what:=frmSearch.TextBox1.Text, _
After:=Range("A65536"), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
End With
If Not rng Is Nothing Then
With frmSearch
.TextBox2.Text = rng.Offset(0, 1).Value
.TextBox3.Text = rng.Offset(0, 2).Value
' and so forth
End With
Else
MsgBox frmSearch.TextBox1.Text & _
" was not found"
End If
End Sub
 
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
Save as Command Line SoDakRah Excel Discussion (Misc queries) 1 July 29th 08 06:12 PM
Excel save command Teddy Excel Discussion (Misc queries) 2 September 14th 07 08:34 PM
Worksheets with OFFSET command always ask if I want to SAVE Jolly good Delaware lad Excel Worksheet Functions 2 April 1st 07 08:40 PM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
Save As command Nikita Excel Programming 1 August 19th 03 08:17 PM


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