Hello everybody!!
I spent a lot of time on a curious bug, and I wanted your advise.
I created a function that must simlpy copy some cells in another range.
This function take a range object as parameter to determine source of
datas to copy:
Public Function PuF_FormatCpyField(V_Range As Range)
' If there is more than 1 project imported, we copy/paste
' the formula to all rows containing data
If GV_NumProjects > 1 Then
With V_Range.Worksheet
V_Range.Rows(2).Copy _
(.Range(.Cells(3, V_Range.Column), .Cells(GV_NumProjects
+ 1, V_Range.Column + V_Range.Columns.Count - 1)))
End If
End With
End Function
.... but this doesn't work, and a beautiful "Copy Method of Range class
failed" occurs...
I've been able to solve this problem by changing
With V_Range.Worksheet
by
With Worksheets("NameOfMyWorksheet")
I really don't understand why this problem happens... Does somebody
have an idea?
Bookmarks