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: 41
Default Help with changing code

Hi all,

I have this code (shown below) which looks up a value in column e and copies
to another worksheet. I have it to copy the whole row, so how can I change
it to only copy columns a & e on row 5 for example.


Dim rng As Range, cell As Range, col As Long
Dim rw As Long
col = 5
rw = 1
With Worksheets("list")
Set rng = .Range(.Cells(1, col), .Cells(Rows.Count, col).End(xlUp))
End With
For Each cell In rng
If LCase(cell.Value) = "yes" Then
cell.EntireRow.Copy Destination:=Worksheets("fortnight") _
.Cells(rw, 1)
rw = rw + 1
End If
Next

Thanks in advance

Greg


 
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
Help with changing code Steve Excel Discussion (Misc queries) 3 March 2nd 09 04:03 PM
changing format code?? please help!!! laandmc Excel Discussion (Misc queries) 2 September 24th 08 09:58 PM
Changing control properties/code through code Ajit Excel Programming 3 October 18th 04 09:03 PM
Changing code Erich Neuwirth Excel Programming 0 August 7th 04 02:27 PM
Changing this code ... Please advise Jako[_39_] Excel Programming 13 July 25th 04 10:01 PM


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