View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Run-time error 1004

Can you explain, in words, what this code is supposed to be doing?

--
Rick (MVP - Excel)



"sebastico" wrote in message
...
Hello
I have this code taht when I run displays Run-timeerror 1004:
Application-defined or object-defined error.

Could you suggest me how to fix it?

Thanks in advance

Sub Copy_transpose()
Dim Row As Integer, Cols As Byte, nRow As Integer
Application.ScreenUpdating = False
nRow = 1

With Worksheets("Sheet1")
For Row = 1 To 668
Cols = Application.CountA(.Range("a" & Row).EntireRow) - 1
Worksheets("Sheet1").Range("a" & nRow).Resize(Cols).Value = .Range("a" &
Row).Value
Worksheets("Sheet1").Range("b" & nRow).Resize(Cols).Value =
Application.Transpose(.Range("b" & Row).Resize(, Cols).Value)
nRow = Worksheets("Sheet2").Range("a65536").End(xlUp).Row + 3
Next
End With
End Sub