Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Loopas
I deal with a spreadsheet that has a list in a column. (On each row
in the column) You can select either open or closed. I wanted to do some sort of Loop whereby If the word Closed (could use a "Find" function?) in that particular row in column F then I would like to cut that row and paste it into another workbook then delete the old row. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Loopas
Sub Macro1()
' ' Macro1 Macro ' Macro recorded 09/12/2008 by AXUKLSLAV ' ' Columns("F:F").Select For Each Row In Columns("F:F") Find(What:="closed", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate 'FindNext(After:=ActiveCell)Activate Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Selection.Cut Sheets("Completed Tasks").Select Range("A2").Select ActiveSheet.Paste Range("A3").Select End Sub ??? Help plz |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Loopas
On Dec 9, 6:49*pm, wrote:
I deal with a spreadsheet that has a list in a column. *(On each row in the column) You can select either open or closed. *I wanted to do some sort of Loop whereby If the word Closed (could use a "Find" function?) in that particular row in column F then I would like to cut that row and paste it into another workbook then delete the old row. Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Loopas
Hi Try this: Sub MoveClosedRows() Dim LastRow As Long Dim r As Long Dim off As Long Application.ScreenUpdating = False LastRow = Range("F" & Rows.Count).End(xlUp).Row For r = LastRow To 2 Step -1 ' Headings in row 1 If Cells(r, "F").Value = "Closed" Then Rows(r).Copy Destination:=Sheets _ ("Completed Tasks").Range("A2").Offset(off, 0) Rows(r).Delete off = off + 1 End If Next Application.ScreenUpdating = True End Sub Regards, Per skrev i meddelelsen ... On Dec 9, 6:49 pm, wrote: I deal with a spreadsheet that has a list in a column. (On each row in the column) You can select either open or closed. I wanted to do some sort of Loop whereby If the word Closed (could use a "Find" function?) in that particular row in column F then I would like to cut that row and paste it into another workbook then delete the old row. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|