• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Cutting & Pasting from one worksheet to another

DNice

New Member
I have a worksheet with open projects listed. When the projects are closed - they are "posted". I need to record the posted date in the Posted Column (K) cell and I would ultimately like for the entered date to trigger the entire row to be cut and pasted to the "closed" worksheet. Right now, I have figured out how to create a button to do this BUT I am having issues with the date. I need the date to stay as entered in the Posted column in "open CS" worksheet when it transfers to the "closed" worksheet.

If there is a way to automate this completely - please share. If my only option is using the "moved to closed CS Worksheet" button I created, it's fine, I just need to correct the date issue.
I tried IsDate("mm/dd/yyyy") and I get False on the "closed" worksheet.
Tried ("anydate") and get Any date on the "closed" worksheet

Here is my code:
Sub MoveToClosed()
'
' MoveToClosed Macro
' When posted date filled, moves row to closed worksheet
'

'
ActiveCell.FormulaR1C1 = "12/28/2016" 'this date will change'
'and should be copied the same on Closed worksheet as entered'
'in open CS worksheet.'
Rows("2:2").Select
Range("G2").Activate
Selection.Cut
Sheets("closed").Select
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
ActiveSheet.Paste
Sheets("open CS").Select
Selection.Delete Shift:=xlUp
Range("K2").Select
End Sub
 

Attachments

Code:
Sub blah()
Set Destn = Sheets("closed").Range("A" & Rows.Count).End(xlUp).Offset(1)
With Cells(ActiveCell.Row, 1).Resize(, 10)
  .Copy Destn
  'Destn.Offset(, 10).FormulaR1C1 = "12/28/2016"
   Destn.Offset(, 10).Value = Now()
  .Delete Shift:=xlUp
End With
End Sub
Make sure the active cell is any cell on the row you want to close/move.
Since you're going to delete everything you put on the row you're about to copy, it makes no sense to add the date on that open cs sheet, so I've added the date only to the closed sheet.
 
Code:
Sub blah()
Set Destn = Sheets("closed").Range("A" & Rows.Count).End(xlUp).Offset(1)
With Cells(ActiveCell.Row, 1).Resize(, 10)
  .Copy Destn
  'Destn.Offset(, 10).FormulaR1C1 = "12/28/2016"
   Destn.Offset(, 10).Value = Now()
  .Delete Shift:=xlUp
End With
End Sub
Make sure the active cell is any cell on the row you want to close/move.
Since you're going to delete everything you put on the row you're about to copy, it makes no sense to add the date on that open cs sheet, so I've added the date only to the closed sheet.


p45cal -
Thank you. This works great. I hadn't thought about just putting date on 2nd sheet. Always good to have other options. Thank you so much, this will be a huge improvement to the process we currently use. Have a great day - Thanks
 
Back
Top