Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Copy/paste rows to new sheet based on cell value

I have a large spreadsheet in which one column returns "check status",
"visit", or "Send Letter 2" based on an IF/THEN formula. Is there a way to
automatically select those rows containing "check status", "visit", and "Send
Letter 2", copy the row and paste it onto a new sheet? Do I need a macro for
this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Copy/paste rows to new sheet based on cell value

This assumes your values are in column A:

Sub CopyRows()
lrow = Sheets(1).Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To lrow
dest = Sheets(2).Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, 1).Value = "check status" Or _
Cells(i, 1).Value = "visit" Or _
Cells(i, 1).Value = "Send Letter 2" Then
Rows(i).Copy Sheets(2).Rows(dest + 1)
End If
Next i
End Sub

--
Dan


On Sep 9, 12:04*pm, Taylor wrote:
I have a large spreadsheet in which one column returns "check status",
"visit", or "Send Letter 2" based on an IF/THEN formula. *Is there a way to
automatically select those rows containing "check status", "visit", and "Send
Letter 2", copy the row and paste it onto a new sheet? *Do I need a macro for
this?

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
copy rows from one Data sheet to another sheet based on cell conte John McKeon Excel Discussion (Misc queries) 2 May 15th 10 06:49 AM
Help: auto-copy entire rows from 1 sheet (based on cell criteria) to another sheet. bertbarndoor Excel Programming 4 October 5th 07 04:00 PM
Copy rows from one sheet to another based on a cell value SM1 New Users to Excel 1 December 21st 06 01:00 AM
Finding a named range based on cell value and copy/paste to same sheet? Simon Lloyd[_715_] Excel Programming 1 May 11th 06 11:25 PM
copy and paste to another sheet based in cell color nat3ten Excel Programming 7 July 8th 05 11:14 PM


All times are GMT +1. The time now is 02:21 PM.

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

About Us

"It's about Microsoft Excel"