Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Conditional CCP entire row

Hi All........
If someone would be so kind, I would like to interrogate Column F of sheet1
and for every value that begins with MISC, to Copy and Paste that entire row
over to Sheet2 (adding it to the bottom of the database there), and then
deleting that row from sheet1. Somehow my recorder just cant get there from
here..........

TIA
Vaya con Dios,
Chuck, CABGx3




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Conditional CCP entire row

Sub MoveData()
Dim rng As Range
Dim rng1 As Range
Dim rng2 As Range
Dim sAddr As String
With Worksheets("Source")
Set rng = .Columns(6).Find("MISC*", _
After:=.Range("F65536"), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
sAddr = rng.Address
Do
If rng1 Is Nothing Then
Set rng1 = rng
Else
Set rng1 = Union(rng, rng1)
End If
Set rng = .Columns(6).FindNext(rng)
Loop Until rng.Address = sAddr
Set rng2 = Worksheets("Destination" _
).Cells(Rows.Count, 1).End(xlUp)(2)
rng1.EntireRow.Copy rng2
rng1.EntireRow.Delete
End If
End With

End Sub

Change sheet names to reflect yours.

--
Regards,
Tom Ogilvy

"CLR" wrote:

Hi All........
If someone would be so kind, I would like to interrogate Column F of sheet1
and for every value that begins with MISC, to Copy and Paste that entire row
over to Sheet2 (adding it to the bottom of the database there), and then
deleting that row from sheet1. Somehow my recorder just cant get there from
here..........

TIA
Vaya con Dios,
Chuck, CABGx3




  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Conditional CCP entire row

That is INSTANTLY COOL Tom..........many many thanks. It does exactly as I
need.

Vaya con Dios,
Chuck, CABGx3



"Tom Ogilvy" wrote:

Sub MoveData()
Dim rng As Range
Dim rng1 As Range
Dim rng2 As Range
Dim sAddr As String
With Worksheets("Source")
Set rng = .Columns(6).Find("MISC*", _
After:=.Range("F65536"), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
sAddr = rng.Address
Do
If rng1 Is Nothing Then
Set rng1 = rng
Else
Set rng1 = Union(rng, rng1)
End If
Set rng = .Columns(6).FindNext(rng)
Loop Until rng.Address = sAddr
Set rng2 = Worksheets("Destination" _
).Cells(Rows.Count, 1).End(xlUp)(2)
rng1.EntireRow.Copy rng2
rng1.EntireRow.Delete
End If
End With

End Sub

Change sheet names to reflect yours.

--
Regards,
Tom Ogilvy

"CLR" wrote:

Hi All........
If someone would be so kind, I would like to interrogate Column F of sheet1
and for every value that begins with MISC, to Copy and Paste that entire row
over to Sheet2 (adding it to the bottom of the database there), and then
deleting that row from sheet1. Somehow my recorder just cant get there from
here..........

TIA
Vaya con Dios,
Chuck, CABGx3




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
Conditional Formatting for entire row HeatherJ Excel Worksheet Functions 5 February 17th 10 08:03 PM
Conditional Formating an entire row cardosol Excel Discussion (Misc queries) 1 May 1st 08 10:06 PM
Conditional Format entire row CrimsonPlague29 Excel Discussion (Misc queries) 3 March 1st 08 02:04 AM
conditional formatting for entire row h20polo Excel Discussion (Misc queries) 2 June 20th 07 09:09 AM
Conditional Formatting Entire Row Daviv Excel Discussion (Misc queries) 1 December 18th 06 07:58 PM


All times are GMT +1. The time now is 11:44 AM.

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"