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: 59
Default Copy, paste, transpose depending on variable

Hi,

Hoping for some help to modify the code below.

I have data in Sheet 1, and if column C = "Trigger", I need to copy the
cells in that row from columns D thru P. Sheet 2 is the destination, and I
am trying to do a copy, paste values and transpose into column A. And then
delete all zero values from column A of sheet 2.

Thank you, and here is the code:

Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim r As Range
Dim c As Range

Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")

Set r = ws1.Range("C1", ws1.Range("C65536").End(xlUp))
For Each c In r.Cells
If c = "Trigger" Then
'need new code here for the copy / paste part
c.EntireRow.Copy
Destination:=ws2.Range("A65536").End(xlUp).Offset( 1, 0)
End If
Next c

'need code here to delete all the zeros
 
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 transpose paste danel Excel Discussion (Misc queries) 0 December 27th 10 08:22 AM
Copy and Transpose Paste HAS Excel Discussion (Misc queries) 2 February 15th 09 01:50 PM
Copy then Paste with a transpose SteveM Excel Discussion (Misc queries) 2 November 29th 07 06:01 PM
Copy and transpose paste across several worksheets JohnP Excel Programming 2 June 6th 07 02:37 PM
Copy and transpose paste JohnP Excel Programming 0 June 5th 07 10:08 PM


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