hi,
I am trying to copy data from cells A2to U305 of worksheet 1 to worksheet 2 , in the same workbook using range object. I seem to be getting overflow error and i am unable to find out the problem. Request some help in finding the issue in my code
Sub CopyData()
Dim SourceRange As Range
Dim DestRange As Range
Set SourceRange = ThisWorkbook.Worksheets(2).Range("A2:U305")
Set DestRange = ThisWorkbook.Worksheets(3).Range("A2:U305")
Set DestRange = DestRange.Resize(SourceRange.Rows.Count, _
SourceRange.Columns.Count)
DestRange.Value = SourceRange.Value
End Sub
I am trying to copy data from cells A2to U305 of worksheet 1 to worksheet 2 , in the same workbook using range object. I seem to be getting overflow error and i am unable to find out the problem. Request some help in finding the issue in my code
Sub CopyData()
Dim SourceRange As Range
Dim DestRange As Range
Set SourceRange = ThisWorkbook.Worksheets(2).Range("A2:U305")
Set DestRange = ThisWorkbook.Worksheets(3).Range("A2:U305")
Set DestRange = DestRange.Resize(SourceRange.Rows.Count, _
SourceRange.Columns.Count)
DestRange.Value = SourceRange.Value
End Sub