#1   Report Post  
Dolphinv4
 
Posts: n/a
Default Autofill

Hi,

how do I write a macro such that it'll copy the active cell and then
autofill to the cell to the right of the active cell?

(ie, active cell is Jun-05 and if i do a manual mouse click drag to the
right, the right cell will show Jul-05)

Thanks,
Dolphin
  #2   Report Post  
Dolphinv4
 
Posts: n/a
Default Autofill

I tried this:

ActiveCell.Select
Selection.AutoFill Destination:=ActiveCell.Offset(-1, 0).Resize(16),
Type:=xlFillDefault

But it don't work! Why?

Regards,
Dolphin

"Dolphinv4" wrote:

Hi,

how do I write a macro such that it'll copy the active cell and then
autofill to the cell to the right of the active cell?

(ie, active cell is Jun-05 and if i do a manual mouse click drag to the
right, the right cell will show Jul-05)

Thanks,
Dolphin

  #3   Report Post  
Stefi
 
Posts: n/a
Default Autofill

This will autofill ONE cell to the right to ActiveCell with next month, same
day:

Selection.AutoFill Destination:=ActiveCell.Resize(1, 2), Type:=xlFillMonths

From your example

Selection.AutoFill Destination:=ActiveCell.Offset(-1, 0).Resize(16),
Type:=xlFillDefault


I suppose you want to autofill 16 columns, if so, apply Resize(1,16)

Regards,
Stefi

"Dolphinv4" wrote:

I tried this:

ActiveCell.Select
Selection.AutoFill Destination:=ActiveCell.Offset(-1, 0).Resize(16),
Type:=xlFillDefault

But it don't work! Why?

Regards,
Dolphin

"Dolphinv4" wrote:

Hi,

how do I write a macro such that it'll copy the active cell and then
autofill to the cell to the right of the active cell?

(ie, active cell is Jun-05 and if i do a manual mouse click drag to the
right, the right cell will show Jul-05)

Thanks,
Dolphin

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofill sisco98 Excel Worksheet Functions 1 June 28th 05 01:30 PM
More- AutoFill with Non-Seqeuntial Cell References ? [email protected] Excel Worksheet Functions 4 June 23rd 05 02:42 AM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
Relative reference autofill increment other than +1 SteveB Excel Discussion (Misc queries) 3 June 14th 05 07:40 PM
AutoFill Visible Cells with Months Elaine New Users to Excel 3 March 16th 05 10:13 PM


All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"