ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   automate cut/insert tasks (https://www.excelbanter.com/excel-programming/381308-re-automate-cut-insert-tasks.html)

JE McGimpsey

automate cut/insert tasks
 
One way:

Public Sub CutToDone()
Dim rToCut As Range
Dim rDest As Range
With Sheets("Jobs")
On Error Resume Next
Set rToCut = .Range("F2:F" & .Range("F" & _
.Rows.Count).End(xlUp).Row).SpecialCells( _
xlCellTypeConstants)
On Error GoTo 0
End With
If Not rToCut Is Nothing Then
With Sheets("Done")
Set rDest = .Range("A" & _
.Rows.Count).End(xlUp).Offset(1, 0)
End With
With rToCut.EntireRow
.Copy Destination:=rDest
.Delete
End With
End If
End Sub


In article ,
BluzDude wrote:

worksheet "Jobs" has jobs listed in each row, on each row cells "A" thru "E"
have text in them, cell "F" is either blank or has a completion date in it. I
want to be able to go down the list and enter dates in column "F" for jobs
that are complete then dut them and delete that row and insert them at the
top of the rows in worksheet "Done". I want to click one button on "Jobs" and
have all the completed jobs, cells "A" thru "F" moved to "Done".

I can record a macro that will accomplish this for a manually selected row
in "Jobs" but don't want to have to do this manually on every row that has a
completion date in "F". I am familiar with "IF" statements within formulas in
Excel but not within macros assigned to buttons.

Thanks



All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com