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?
Hi,
Can you please post an example workbook? so I can see what your working with.
Thank You, Mike
Some Helpful Hints:
1. New members please read & follow the Forum Rules
2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
3. If you are pleased with a solution mark your post SOLVED.
4. Thank those who have help you by clicking the scales at the top right of the post.
Here...
thanks for the reply, an example worksheet is attached.
Hi Guys,
any help with this one? please take a look at my example workbook and let me know.
bump?
thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks