LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Copying an Entire row using an IF Statement

sorry for reposting this

But i need to be able to use the <= = commands with this
code is this possible.
Sub test()
Dim i As Long, rng As Range, str As String

str = "1st Quarter Quarter"
Set rng = Worksheets("Sheet2").Rows(1)

With Worksheets("Data")
For i = 2 To .Cells(Rows.Count, 2).End(xlUp).Row
If StrComp(.Cells(i, 2).Value, str) = 1 Then
.Rows(i).Copy rng
Set rng = rng.Offset(1)
End If
Next
End With
End Sub

 
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
If statement to copy an entire row to other worksheet w/ in same b hshayh0rn Excel Worksheet Functions 7 May 1st 09 09:05 PM
copy an entire row IF a statement is true colettey29 Excel Worksheet Functions 1 June 15th 07 06:43 PM
Copying entire worksheets Todd Nelson Excel Discussion (Misc queries) 2 August 31st 05 06:50 PM
Copying an Entire row using an IF Statement Marcus Excel Programming 2 July 5th 04 03:19 PM
Macro for copying entire raw Mac[_5_] Excel Programming 3 November 13th 03 03:09 AM


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