Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Macro to find and paste rows

I need a macro to find every timt "Revoked" is found in Column C, cut the
row, and paste it into Sheet2 of current worksheet. I need it to loop
through and cut all rows with "Revoked" and then paste so all are available
in Sheet 2. This below only does the action once, but I dont know how to make
it loop and stop when no more Revokes are found.
THANK YOU!

Cells.Find(What:="Revoked", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
End With
Sheets("Sheet2").Select
ActiveCell.Offset(-6, -1).Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Macro to find and paste rows

As an alternative to your macro, consider using an AutoFilter. You can use
the filter to display only the rows with Revoked in column C. Then you can
copy/paste all the required rows with only one copy/paste.
--
Gary''s Student
gsnu200707


"kayabob" wrote:

I need a macro to find every timt "Revoked" is found in Column C, cut the
row, and paste it into Sheet2 of current worksheet. I need it to loop
through and cut all rows with "Revoked" and then paste so all are available
in Sheet 2. This below only does the action once, but I dont know how to make
it loop and stop when no more Revokes are found.
THANK YOU!

Cells.Find(What:="Revoked", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
End With
Sheets("Sheet2").Select
ActiveCell.Offset(-6, -1).Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Macro to find and paste rows

Gary - This didnt quite work - I need the records removed from sheet 1 and
pasted to sheet. The cut with the autofilter takes all the hidden rows in
the autofilter too.

Any other suggestions are appreciated!!!
================================================== ==

"Gary''s Student" wrote:

As an alternative to your macro, consider using an AutoFilter. You can use
the filter to display only the rows with Revoked in column C. Then you can
copy/paste all the required rows with only one copy/paste.
--
Gary''s Student
gsnu200707


"kayabob" wrote:

I need a macro to find every timt "Revoked" is found in Column C, cut the
row, and paste it into Sheet2 of current worksheet. I need it to loop
through and cut all rows with "Revoked" and then paste so all are available
in Sheet 2. This below only does the action once, but I dont know how to make
it loop and stop when no more Revokes are found.
THANK YOU!

Cells.Find(What:="Revoked", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
End With
Sheets("Sheet2").Select
ActiveCell.Offset(-6, -1).Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro to find and paste rows

With filter enabled..........F5SpecialVisible cells onlyOK

Copy(you're not allowed to Cut) then switch to target sheet and Paste. Do not
hit ENTER

Switch back to source sheet and EditDelete Row

The filtered data will be gone from source sheet.


Gord Dibben MS Excel MVP

On Tue, 20 Feb 2007 14:56:08 -0800, kayabob
wrote:

Gary - This didnt quite work - I need the records removed from sheet 1 and
pasted to sheet. The cut with the autofilter takes all the hidden rows in
the autofilter too.

Any other suggestions are appreciated!!!
================================================= ===

"Gary''s Student" wrote:

As an alternative to your macro, consider using an AutoFilter. You can use
the filter to display only the rows with Revoked in column C. Then you can
copy/paste all the required rows with only one copy/paste.
--
Gary''s Student
gsnu200707


"kayabob" wrote:

I need a macro to find every timt "Revoked" is found in Column C, cut the
row, and paste it into Sheet2 of current worksheet. I need it to loop
through and cut all rows with "Revoked" and then paste so all are available
in Sheet 2. This below only does the action once, but I dont know how to make
it loop and stop when no more Revokes are found.
THANK YOU!

Cells.Find(What:="Revoked", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
End With
Sheets("Sheet2").Select
ActiveCell.Offset(-6, -1).Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro to find and paste rows

On second thought, I don't like this.

It deletes the header row also.


Gord

On Tue, 20 Feb 2007 15:20:39 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

With filter enabled..........F5SpecialVisible cells onlyOK

Copy(you're not allowed to Cut) then switch to target sheet and Paste. Do not
hit ENTER

Switch back to source sheet and EditDelete Row

The filtered data will be gone from source sheet.


Gord Dibben MS Excel MVP

On Tue, 20 Feb 2007 14:56:08 -0800, kayabob
wrote:

Gary - This didnt quite work - I need the records removed from sheet 1 and
pasted to sheet. The cut with the autofilter takes all the hidden rows in
the autofilter too.

Any other suggestions are appreciated!!!
================================================ ====

"Gary''s Student" wrote:

As an alternative to your macro, consider using an AutoFilter. You can use
the filter to display only the rows with Revoked in column C. Then you can
copy/paste all the required rows with only one copy/paste.
--
Gary''s Student
gsnu200707


"kayabob" wrote:

I need a macro to find every timt "Revoked" is found in Column C, cut the
row, and paste it into Sheet2 of current worksheet. I need it to loop
through and cut all rows with "Revoked" and then paste so all are available
in Sheet 2. This below only does the action once, but I dont know how to make
it loop and stop when no more Revokes are found.
THANK YOU!

Cells.Find(What:="Revoked", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
End With
Sheets("Sheet2").Select
ActiveCell.Offset(-6, -1).Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to: Find a Reference, and then Paste into the 10 Rows Below Blobbies Excel Discussion (Misc queries) 9 March 14th 06 11:17 AM
Macro to find, copy, and paste until value change Valerie Excel Worksheet Functions 4 January 26th 06 04:10 AM
Macro to Find, Cut, and Paste Rob Excel Discussion (Misc queries) 3 September 1st 05 09:37 PM
I need a macro to find cut and paste data to new cell Rex Excel Discussion (Misc queries) 0 December 6th 04 12:45 AM
I need a macro to find cut and paste data to new cell Rex Excel Discussion (Misc queries) 0 December 6th 04 12:23 AM


All times are GMT +1. The time now is 04:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"