A
AirgasRob
Greetings and thank you for taking the time to help me.
I want to be able to go across row 1 until I meet criteria >0.
Then copy 18 cells (columns) across and paste them to row 2.
For example A10 is first cell that >0
copy that cell and the next 17 cells in that row
paste in B10 across.
The sub I was using works great but only for copying columns across.
Sub LoopCol5()
Dim RngCol5 As Range
Dim i As Range
Dim c As Long
Set RngCol5 = Range("AS4", Range("AS" & Rows.Count).End(xlUp))
For Each i In RngCol5
Select Case i.Value
Case "1": c = 10
Case Else: c = -9999
End Select
If c > -9999 Then
Cells(i.Row, 8).Value = Cells(i.Row, c).Value
End If
Next i
End Sub
I want to be able to go across row 1 until I meet criteria >0.
Then copy 18 cells (columns) across and paste them to row 2.
For example A10 is first cell that >0
copy that cell and the next 17 cells in that row
paste in B10 across.
The sub I was using works great but only for copying columns across.
Sub LoopCol5()
Dim RngCol5 As Range
Dim i As Range
Dim c As Long
Set RngCol5 = Range("AS4", Range("AS" & Rows.Count).End(xlUp))
For Each i In RngCol5
Select Case i.Value
Case "1": c = 10
Case Else: c = -9999
End Select
If c > -9999 Then
Cells(i.Row, 8).Value = Cells(i.Row, c).Value
End If
Next i
End Sub