Cut & Paste Data into different worksheet based on specific criteria

  • Thread starter Thread starter hailnorm
  • Start date Start date
H

hailnorm

(1) I have recorded a macro that cleans up exported reports & puts it
into a format that I need. The final result of this macro is a
worksheet that all the data that I need including $ amounts is
formatted correctly & a preceding column that indicates if the $ amount
is over a predefined amount.

What I need is a macro that will look at the "under/over" column & Cut
& Pastes all the "over" $ amounts data into another worksheet.

So in the end, I have an "Under" & an "Over" worksheet where the $
amounts & corressponding data are seperated by the predefined $ limit.
 
z = 1

Do
x = x + 1
Loop Until Worksheets(1).Cells(1, 1) = ""

For y = 1 To x
If Worksheets(1).Cells(y, undOvr).Value = "Over" Then
Worksheets(1).Rows(y).Cut
Worksheets(2).Rows(z).Insert
z = z + 1
End If
Next y
-----Original Message-----

(1) I have recorded a macro that cleans up exported reports & puts it
into a format that I need. The final result of this macro is a
worksheet that all the data that I need including $ amounts is
formatted correctly & a preceding column that indicates if the $ amount
is over a predefined amount.

What I need is a macro that will look at the "under/over" column & Cut
& Pastes all the "over" $ amounts data into another worksheet.

So in the end, I have an "Under" & an "Over" worksheet where the $
amounts & corressponding data are seperated by the predefined $ limit.


------------------------------------------------

~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step
guide to creating financial statements
 
Change B4 to the upper left corner of your data. Change 2 to indicate the
relative column in your data that contains the over under values (assumes it
is text "over")

Sub AATester6()
Dim rng As Range
ActiveSheet.AutoFilterMode = False
Range("B4").AutoFilter Field:=2, Criteria1:="over"
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy Destination:= _
Worksheets("Over").Range("A1")
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1)
rng.SpecialCells(xlCellTypeVisible).EntireRow.Delete
rng.AutoFilter

End Sub


--
Regards,
Tom Ogilvy




hailnorm said:
(1) I have recorded a macro that cleans up exported reports & puts it
into a format that I need. The final result of this macro is a
worksheet that all the data that I need including $ amounts is
formatted correctly & a preceding column that indicates if the $ amount
is over a predefined amount.

What I need is a macro that will look at the "under/over" column & Cut
& Pastes all the "over" $ amounts data into another worksheet.

So in the end, I have an "Under" & an "Over" worksheet where the $
amounts & corressponding data are seperated by the predefined $ limit.


------------------------------------------------



~~Now Available: Financial Statements.xls, a step by step guide to
creating financial statements
 
Back
Top