Autofill

D

Dolphinv4

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
 
D

Dolphinv4

I tried this:

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

But it don't work! Why?

Regards,
Dolphin
 
S

Stefi

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
 
Top