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: 151
Default Code to copy selective cells from matching rows

Hi

the following code writes the whole row, when the look value is found
if i require from the found row, only value (number, string or date) in cell
of columns c,d,e,j,k,m only has to be brought, then
what should be my code.

For lngRow = 1 To lngLastRow1
' If Format(SourceSheet.Range("A" & lngRow), "ddmmm") = "05Aug" Then
If SourceSheet.Range("E" & lngRow).Value = varFind Then
SourceSheet.Rows(lngRow).Copy TargetSheet.Rows(lngLastRow2 + 2)
lngLastRow2 = lngLastRow2 + 1
End If
Next

thank you all.


 
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 matching value rows to other sheet tkraju via OfficeKB.com Excel Discussion (Misc queries) 2 June 7th 09 12:41 PM
count number of rows with 2 matching text cells smcmoran Excel Worksheet Functions 5 September 29th 08 05:53 PM
Matching rows in 2 sheets and copying matching rows from sheet 1 t fbagirov Excel Programming 1 April 8th 07 03:44 PM
copy / paste selective rows Kenny Kendrena via OfficeKB.com Excel Discussion (Misc queries) 5 February 7th 05 12:55 PM
Loop cells - get all rows with matching data - paste into different wb Buffyslay_co_uk Excel Programming 2 July 23rd 04 01:20 PM


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