Thread: Efficient Code
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis[_3_] Dana DeLouis[_3_] is offline
external usenet poster
 
Posts: 690
Default Efficient Code

Hi. I'm not sure how your sheet is set up, but would there be any ideas
here that may help? I assume you have constants in column L, but you can
change that. One option would be to take the union of both Constants and
Formulas in Column L if you needed to. The idea here is that you can copy
multiple areas at one time vs Cut. Here, I did not look at Column B.


Sub Demo()
Dim rFRom As Range
Dim rTo As Range
Dim C As Long 'Column #

Set rTo = Sheets("Completed").Cells(Rows.Count, 1).End(xlUp)(2, 1)

On Error Resume Next
C = [L1].Column
Set rFRom = Range(Cells(4, C), Cells(Rows.Count,
C)).SpecialCells(xlCellTypeConstants) ' or xlCellTypeFormulas
If Err.Number 0 Then Exit Sub

rFRom.EntireRow.Copy rTo
rFRom.EntireRow.Delete
End Sub

--
Dana DeLouis
Win XP & Office 2003


"GregR" wrote in message
ps.com...
Bob, KeepITcool, thanks

Greg