ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   AutoFill columns (https://www.excelbanter.com/excel-programming/327510-autofill-columns.html)

Charlie[_9_]

AutoFill columns
 
Is there a way I can specify a starting column and number of columns in the
following statement:

Selection.AutoFill Destination:=Columns("D:H"), Type:=xlFillDefault

Starting column is D
Number of colums?




Tom Ogilvy

AutoFill columns
 
NumColumns = 5
Selection.AutoFill Destination:=Columns("D:D").Resize(,NumColumns),
Type:=xlFillDefault

--
Regards,
Tom Ogilvy

"Charlie" wrote in message
...
Is there a way I can specify a starting column and number of columns in

the
following statement:

Selection.AutoFill Destination:=Columns("D:H"), Type:=xlFillDefault

Starting column is D
Number of colums?






Bob Phillips[_6_]

AutoFill columns
 
Selection.AutoFill Destination:=Range("D1").Resize(1, 4).EntireColumn,
Type:=xlFillDefault

although, as the source and initial destination are the same why not use

Dim myRange As Range
Set myRange = Selection.EntireColumn
myRange.AutoFill Destination:=myRange.Resize(1, 4).EntireColumn,
Type:=xlFillDefault

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Charlie" wrote in message
...
Is there a way I can specify a starting column and number of columns in

the
following statement:

Selection.AutoFill Destination:=Columns("D:H"), Type:=xlFillDefault

Starting column is D
Number of colums?






Charlie[_9_]

AutoFill columns
 
Thanks

"Tom Ogilvy" wrote in message
...
NumColumns = 5
Selection.AutoFill Destination:=Columns("D:D").Resize(,NumColumns),
Type:=xlFillDefault

--
Regards,
Tom Ogilvy

"Charlie" wrote in message
...
Is there a way I can specify a starting column and number of columns in

the
following statement:

Selection.AutoFill Destination:=Columns("D:H"), Type:=xlFillDefault

Starting column is D
Number of colums?








Charlie[_9_]

AutoFill columns
 
Thanks

"Bob Phillips" wrote in message
...
Selection.AutoFill Destination:=Range("D1").Resize(1, 4).EntireColumn,
Type:=xlFillDefault

although, as the source and initial destination are the same why not use

Dim myRange As Range
Set myRange = Selection.EntireColumn
myRange.AutoFill Destination:=myRange.Resize(1, 4).EntireColumn,
Type:=xlFillDefault

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Charlie" wrote in message
...
Is there a way I can specify a starting column and number of columns in

the
following statement:

Selection.AutoFill Destination:=Columns("D:H"), Type:=xlFillDefault

Starting column is D
Number of colums?









All times are GMT +1. The time now is 01:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com