Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Moving a row based on content of a cell to a diff worksheet
I would like to move a row to a different worksheet. I have come across the
following code to delete a cell. Can it be modified or is there a better way.... Thanks Bruce _________________ Sub DeleteRowsContaining() Dim r As Long Dim ans As String Dim c As Range Dim lrow As Long ans = InputBox("What string do you want rows to be deleted if they contain it?") Application.ScreenUpdating = False lrow = ActiveSheet.UsedRange.Row - 1 + _ ActiveSheet.UsedRange.Rows.Count For r = lrow To 1 Step -1 With Cells(r, 1) Set c = .Find(ans, LookIn:=xlValues) If Not c Is Nothing Then .EntireRow.Delete End If End With Next r Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro help: moving specific cells based upon content | Excel Worksheet Functions | |||
Assign Color to a Cell based on another Cell on a diff Sheet | Excel Worksheet Functions | |||
how can I conditionally format a cell based on the value in a diff | Excel Discussion (Misc queries) | |||
Create formula that will pull a value based on text in diff cell? | Excel Discussion (Misc queries) | |||
How can I 'diff' [compare content between] two Excel workbooks? | Excel Discussion (Misc queries) |