Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace Original Row with Updated Row

Status
Not open for further replies.

THarte

Programmer
May 8, 2002
28
US
XL2000

I am using this code to finds a certain record (on Sheet2), writes it to another sheet (Sheet3) so it can be manipuled the pull certain columns into a userform to be manipulated.

Private Sub CommandButton2_Click()
Dim sPolNum As String
Dim sLstNam As String
Dim sFound As String
Dim oPolNum As Object
Dim oLstNam As Object

Do
With worksheets(2).Range("J:J", "L:L")
sPolNum = InputBox(Prompt:="Enter Policy Number or Last Name:")
Sheets(2).Select
Set oPolNum = .Find(sPolNum)
If Not oPolNum Is Nothing Then
sFound = oPolNum.Address
Range(sFound).EntireRow.Copy
Sheets(3).Select
Cells(65536, 1).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Cells(65536, 1).End(xlUp).Offset(1, 0).Select
End If
End With

Loop Until Not oPolNum Is Nothing

Application.CutCopyMode = False

Call Fill_Form
End Sub


Once the Manipulations are Done I replace (on Sheet3)any old values that have changed with new ones.

What I have not been able to figure out is how to now take this Row of Data from Sheet3 and Replace the original row on Sheet2.

With the code above does sfound retain the address of the original cell
found? Would I use that?

Sorry so long, I am a newbie and I cannot find references how to do this anywhere. I have tried no less than 25 things myself and keep coming up with nothing.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top