scubadivingfool
New Member
- Joined
- Jun 17, 2010
- Messages
- 35
I am using the following code to copy rows from on sheet and make them columns onto another sheet. The code copies every row in the specific sheet however I just need the ones colored in red.
VBA Code:
Sub PrintToLargeTags()
Dim pc As Worksheet 'PriceChange
Dim lt As Worksheet 'LargeTags
Dim count_col As Integer
Dim count_row As Integer
Dim i As Integer
Dim j As Integer
Set pc = ThisWorkbook.Sheets("PriceChange")
Set lt = ThisWorkbook.Sheets("LargeTags")
lt.Cells.ClearContents
pc.Activate
count_col = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlToRight)))
count_row = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlDown)))
For i = 1 To count_col
For j = 1 To count_row
lt.Cells(i, j) = pc.Cells(j, i).Text
Next j
Next i
lt.Activate
End Sub