+ Reply to Thread
Results 1 to 3 of 3

Autofill:write a macro

Hybrid View

  1. #1
    Dolphinv4
    Guest

    Autofill:write a macro

    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. #2
    Dolphinv4
    Guest

    re: Autofill:write a macro

    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. #3
    Stefi
    Guest

    re: Autofill:write a macro

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1