Good afternoon everyone. I have some vba code that I use within Excel. I'm trying to modify this code so it will copy/paste values across columns instead of rows. Can someone help me to modify this? I modified it to what I understand but it still is running down rows instead of columns. Thank you very much in advance!
Original code...
Sub pastingvalues()
Set orig = Sheets(1).Range("b1:B20")
For i = 1 To orig.Rows.Count
If IsError(orig.Cells(i, 1)) = False Then
orig.Cells(i, 1) = orig.Cells(i, 1).Value
End If
Next i
End Sub
My modified code (which doesn't work)
Sub pastingvalues()
Set orig = Sheets(1).Range("F3:A06")
For i = 1 To orig.Columns.Count
If IsError(orig.Cells(i, 1)) = False Then
orig.Cells(i, 1) = orig.Cells(i, 1).Value
End If
Next i
End Sub
Original code...
Sub pastingvalues()
Set orig = Sheets(1).Range("b1:B20")
For i = 1 To orig.Rows.Count
If IsError(orig.Cells(i, 1)) = False Then
orig.Cells(i, 1) = orig.Cells(i, 1).Value
End If
Next i
End Sub
My modified code (which doesn't work)
Sub pastingvalues()
Set orig = Sheets(1).Range("F3:A06")
For i = 1 To orig.Columns.Count
If IsError(orig.Cells(i, 1)) = False Then
orig.Cells(i, 1) = orig.Cells(i, 1).Value
End If
Next i
End Sub