![]() |
Cut & Paste Data into different worksheet based on specific criteria
(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. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~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 |
Cut & Paste Data into different worksheet based on specific criteria
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. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~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 . |
Cut & Paste Data into different worksheet based on specific criteria
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.Dele te rng.AutoFilter End Sub -- Regards, Tom Ogilvy hailnorm wrote in 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. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~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 |
All times are GMT +1. The time now is 08:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com