ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Atofill Questions (https://www.excelbanter.com/excel-programming/404571-atofill-questions.html)

lwm

Atofill Questions
 
I did this with the macro recorder and it does not work.

ActiveCell.FormulaR1C1 = "Jan"
Selection.AutoFill Destination:=ActiveCell.Range("A1:L1"), Type:= _
xlFillDefault
ActiveCell.Range("A1:L1").Select

I am looking for an easy way top pread the months across the top of the
page. This is for a calss on macros and how to modify.

Thanks in advance.

GTVT06

Atofill Questions
 
On Jan 18, 2:35*pm, lwm wrote:
I did this with the macro recorder and it does not work.

* * * * ActiveCell.FormulaR1C1 = "Jan"
* * Selection.AutoFill Destination:=ActiveCell.Range("A1:L1"), Type:= _
* * * * xlFillDefault
* * ActiveCell.Range("A1:L1").Select

I am looking for an easy way top pread the months across the top of the
page. *This is for a calss on macros and how to modify.

Thanks in advance.


Hello Try this:

Range("A1").FormulaR1C1 = "Jan"
Range("B1").FormulaR1C1 = "Feb"
Range("A1:B1").Select
Selection.AutoFill Destination:=Range("A1:L1"),
Type:=xlFillDefault
Range("A1:L1").Select

lwm

Atofill Questions
 
Found the problem I was running from the editor instead of wroksheet

"lwm" wrote:

I did this with the macro recorder and it does not work.

ActiveCell.FormulaR1C1 = "Jan"
Selection.AutoFill Destination:=ActiveCell.Range("A1:L1"), Type:= _
xlFillDefault
ActiveCell.Range("A1:L1").Select

I am looking for an easy way top pread the months across the top of the
page. This is for a calss on macros and how to modify.

Thanks in advance.


lwm

Atofill Questions
 
Thanks That will work also.

"GTVT06" wrote:

On Jan 18, 2:35 pm, lwm wrote:
I did this with the macro recorder and it does not work.

ActiveCell.FormulaR1C1 = "Jan"
Selection.AutoFill Destination:=ActiveCell.Range("A1:L1"), Type:= _
xlFillDefault
ActiveCell.Range("A1:L1").Select

I am looking for an easy way top pread the months across the top of the
page. This is for a calss on macros and how to modify.

Thanks in advance.


Hello Try this:

Range("A1").FormulaR1C1 = "Jan"
Range("B1").FormulaR1C1 = "Feb"
Range("A1:B1").Select
Selection.AutoFill Destination:=Range("A1:L1"),
Type:=xlFillDefault
Range("A1:L1").Select



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

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