Yes....somebody suggested the same thing and wrote macro for me. It works really great except that
1. I can move only one row at a time instead of moving certain rows (eg R15,R18 and R22) from "Customer Stock" sheet to "Collected Stock" sheet.
Or better still, is it possible, if once i put the date in the "Invoice Posting Date" column, it should automatically trigger the "move" message box ?
2. The moved row is placed on the bottom instead on the top.
can you help me to improve the macro ?
Open the attached file, select any row in the "Customer Stock" sheet and then run the macro (ctrl + m),
It will move the selected row from unprotected "Customer Stock" sheet to the protected "Collected Stock" sheet
Sub Customer_Stock()
Dim drc, dx As Long
Application.ScreenUpdating = False
Application.DisplayAlerts = False
response = MsgBox("Are you sure you want to move the selected row from Customer Stock to Collected Stock?", vbYesNo)
If response <> 6 Then
MsgBox "No row moved!!"
Exit Sub
Else
Worksheets("Collected Stock").Unprotect Password:="a27826" ' change the password to whatever you wish
Sheets("Customer Stock").Select
dx = ActiveCell.Row
Rows(dx).Select
Selection.Cut
Sheets("Collected Stock").Select
drc = Range("A" & Application.Rows.Count).End(xlUp).Row + 1
Rows(drc).Select
ActiveSheet.Paste
Columns.AutoFit
Range("A1").Select
Worksheets("Collected Stock").Protect Password:="a27826" ' change the password to whatever you wish
Sheets("Customer Stock").Select
icstmr = Worksheets("Customer Stock").Cells(dx, 2).Value
Application.ScreenUpdating = True
Application.DisplayAlerts = True
MsgBox icstmr & " the selected row has been moved to Collected Stock"
End If
End Sub
Moderator Note:
I added code tags around your code. Pls next time to it yourself according the forum rules.
Bookmarks