Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Moving data to another Sheet

I was looking at another question and the folowing was suggested

Sub stance()
Dim MyRange
Dim copyrange As Range
Lastrow = Cells(Cells.Rows.Count, "D").End(xlUp).Row
Set MyRange = Range("D1:D" & Lastrow)
For Each C In MyRange
If UCase(C.Value) = "R" Then
If copyrange Is Nothing Then
Set copyrange = C.EntireRow
Else
Set copyrange = Union(copyrange, C.EntireRow)
End If
End If
Next
If Not copyrange Is Nothing Then
copyrange.Copy
Sheets("Resigned").Range("A1").PasteSpecial
End If
End Sub

How can I change it to copy the row that has anything in column A with
44OP- in. The spreadsheet has two blank lines in-between each row of data.

Thanks for any help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving data to another Sheet


SOmething like...
For Each C In MyRange
If C.OffSet(0,-3)="440P-" Then
C.EntireRow.Copy Destination:=Sheets("Resigned").Range("A" &
Rows.Count).End(xlUp).OffSet(1,0)
....etc


--
The Code Cage Team

Regards,
The Code Cage Team
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=5647

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
Moving data from one sheet to another Kennedy Excel Discussion (Misc queries) 2 March 10th 10 02:08 PM
moving data from one sheet to another rjagathe New Users to Excel 1 January 20th 10 05:00 PM
Moving data from one sheet to another- How to? mbqc Excel Worksheet Functions 2 May 8th 06 06:05 AM
Moving row data to another sheet RickK Excel Programming 3 October 13th 03 06:39 PM
Moving Data from one sheet to another Patty Garrity Excel Programming 1 August 18th 03 06:20 PM


All times are GMT +1. The time now is 06:25 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"