coolhandphil
03-08-2007, 07:34 AM
Hi,
I need to autofill a range of cells x number of columns to the right.
To give some detail:
I have a table of data which shrinks and grows in length. I also want to give the user the option to change the number of months of data to display.
I have managed to select the existing data that I want to drag across. However I keep getting an error when I try to set it to the new destination.
My code is as follows:
Range(Cells(7, LastReportColumn - 1), Cells(LastReportRow, LastReportColumn - 1)).Select
Set DestinationRange = Range(Cells(7, ReqMonths + 5), Cells(LastReportRow, ReqMonths + 5))
Selection.AutoFill Destination:=(DestinationRange), Type:=xlFillDefault
Regards,
Phil
I need to autofill a range of cells x number of columns to the right.
To give some detail:
I have a table of data which shrinks and grows in length. I also want to give the user the option to change the number of months of data to display.
I have managed to select the existing data that I want to drag across. However I keep getting an error when I try to set it to the new destination.
My code is as follows:
Range(Cells(7, LastReportColumn - 1), Cells(LastReportRow, LastReportColumn - 1)).Select
Set DestinationRange = Range(Cells(7, ReqMonths + 5), Cells(LastReportRow, ReqMonths + 5))
Selection.AutoFill Destination:=(DestinationRange), Type:=xlFillDefault
Regards,
Phil