Hi everyone,
I am using the following code to move certain cells from one sheet to another. The user puts a name in a textbox, it then finds that name on the sheet and copies the correct cells over.
I would like a code which moves those cells back to thier original location (overwritting the existing). This code will be run after the user has made changes to the contents of the cells..
So for example...cells are in sheet1...below code pulls them to sheet2..the user makes changes to cell contents....the NEW code moves them back to thier original location, overwritting the existing.
Private Sub CommandButton3_Click()
Dim DestSheet As Worksheet
Dim wsSearchSheet As Worksheet
Set DestSheet = Worksheets("VIEWER")
Set wsSearchSheet = Worksheets("MASTER")
Dim sRow As Long
Dim sCount As Long
sCount = 0
With wsSearchSheet
For sRow = 1 To .Range("A" & Rows.Count).End(xlUp).Row
If .Cells(sRow, "A") Like ViewCompany.TextBox1.Value Then
sCount = sCount + 1
.Range(.Range("A" & sRow).Resize(1, 7), .Range("A" & sRow).Resize(1, 7).End(xlDown).Offset(0, 0)).Copy _
Destination:=DestSheet.Range("A" & Rows.Count).End(xlUp).Offset(0, 0)
End If
Next sRow
End With
Unload Me
Sheets("VIEWER").Visible = True
Sheets("VIEWER").Select
ViewSingleExit.Show vbModeless
End Sub
Any ideas?
Bookmarks