Hello I have the code for copying the particular row and paste it in particular column
the code is
Range(rng, rng.End(xlToRight)).copy
Columns(c).Offset(, 6).PasteSpecial Transpose:=True
It is working correctly
But when i wanted to start pasting it from 2 cell of particular column i,e
Range(rng, rng.End(xlToRight)).copy
Columns(c).Offset(2, 6).PasteSpecial Transpose:=True
it is giving
“object defined error”
please help me
This should work:
In the above ling you are selecting Row 2 by
Cells(2,and 6 columns to the right of whatever c is byColumns(c).Column).Offset(,6).Column)The reason that
Columns(c).Offset(2,6)does not work is because you are telling excel to Offset anEntire Columnby 2 rows, which you can’t since it would effectively push the data off the worksheet.You can offset
EntireColumnsfor a given number of columns andEntireRowsfor a given number of rows, but notEntireColumnsby Rows andEntireRowsby Columns.