LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default copy row from one sheet to another if certain condition is met

hi,

Sub test()
Dim sh1 As Sheets, sh2 As Sheets, n As Long, i As Long, rw As Long
Set sh1 = Sheets("Sheet1")
Set sh2 = Sheets("Sheet6")

n = 20 '------------------------- may be adapt to Cells(sh1.Rows.Count,
1).End(xlUp).Row

For i = 1 To n
If sh1.Cells(i, 19) = "x" Then
rw = Cells(sh2.Rows.Count, 1).End(xlUp).Row + 1
sh1.Rows(i).Copy sh2.Cells(rw, 1)
End If
Next
End Sub

isabelle

Le 2015-04-10 23:13, a écrit :
If sheet1 has an x in column S

copy sheet1 entire row to next blank row in sheet 6

 
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-if condition met-copy and paste row to new sheet ScottMSP Excel Programming 6 November 26th 08 07:28 AM
Copy Specific Cells To A New Sheet On Condition jenloe Excel Programming 0 August 19th 08 06:38 PM
Copy from one Sheet and paste on another sheet based on condition Prem Excel Discussion (Misc queries) 2 December 24th 07 05:05 AM
copy data to another sheet on condition vijaydsk1970 Excel Worksheet Functions 1 March 22nd 07 04:12 AM
Copy certain cells from one sheet to another with a condition [email protected] Excel Worksheet Functions 1 January 3rd 07 11:08 PM


All times are GMT +1. The time now is 12:50 AM.

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"