+ Reply to Thread
Results 1 to 6 of 6

Recording macros with autofill

  1. #1
    Registered User
    Join Date
    04-15-2004
    Posts
    18

    Recording macros with autofill

    Hi,

    I've oft have occasion to record macros, yet I'm not very good so...

    How do you do the equivalent of auto-fill a column by double clicking the bottom right hand corner of a cell. When I do this in a macro I record, rather than record the auto-fill of a series of data for the length of data it puts in the range that should be auto-filled. It means that if i use the macro again on a sheet with a different amount of data I'll get missing results of cell errors.

    Any help would be appreciated.

    Andy

  2. #2
    CLR
    Guest

    RE: Recording macros with autofill

    I'm afraid that's just the way Excel records that function and you're stuck
    unless you want to get into the VB Editor and edit your macro.

    Where the recorded macro would have a line like this.....
    Selection.AutoFill Destination:=Range("L8:L1055")

    You would have to change it to look like this.....
    Selection.AutoFill Destination:=Range("L8:L" & _
    Cells(Rows.Count, 1).End(xlUp).Row)

    If you want to try this, be sure to do so on a copy of your file in case of
    things happening that you didn't want to have happen..........

    hth
    Vaya con Dios,
    Chuck, CABGx3




    "andyiain" wrote:

    >
    > Hi,
    >
    > I've oft have occasion to record macros, yet I'm not very good so...
    >
    > How do you do the equivalent of auto-fill a column by double clicking
    > the bottom right hand corner of a cell. When I do this in a macro I
    > record, rather than record the auto-fill of a series of data for the
    > length of data it puts in the range that should be auto-filled. It
    > means that if i use the macro again on a sheet with a different amount
    > of data I'll get missing results of cell errors.
    >
    > Any help would be appreciated.
    >
    > Andy
    >
    >
    > --
    > andyiain
    > ------------------------------------------------------------------------
    > andyiain's Profile: http://www.excelforum.com/member.php...fo&userid=8335
    > View this thread: http://www.excelforum.com/showthread...hreadid=552698
    >
    >


  3. #3
    Registered User
    Join Date
    04-15-2004
    Posts
    18
    Hi, thanks for the reply,

    I modified the macro as suggested but when i ran it i got a dialogue error box with just the number 400 in it, when i hit help it didn't do anything. Anyone know what this means?

    Regards
    Andy

  4. #4
    CLR
    Guest

    Re: Recording macros with autofill

    The code works fine in my model.........please post your macro.

    Vaya con Dios,
    Chuck, CABGx3



    "andyiain" wrote:

    >
    > Hi, thanks for the reply,
    >
    > I modified the macro as suggested but when i ran it i got a dialogue
    > error box with just the number 400 in it, when i hit help it didn't do
    > anything. Anyone know what this means?
    >
    > Regards
    > Andy
    >
    >
    > --
    > andyiain
    > ------------------------------------------------------------------------
    > andyiain's Profile: http://www.excelforum.com/member.php...fo&userid=8335
    > View this thread: http://www.excelforum.com/showthread...hreadid=552698
    >
    >


  5. #5
    Registered User
    Join Date
    04-15-2004
    Posts
    18
    Hi Chuck,

    Thanks for that.

    I'm not too familiar (to say the least) with VBA, seems I mucked things up when I tried to type this in to the Macro.

    It is sorted now.

    Many thanks for all your help.

    Andy

  6. #6
    CLR
    Guest

    Re: Recording macros with autofill

    Glad you got it working.........thanks for the feedback.

    Vaya con Dios,
    Chuck, CABGx3



    "andyiain" wrote:

    >
    > Hi Chuck,
    >
    > Thanks for that.
    >
    > I'm not too familiar (to say the least) with VBA, seems I mucked things
    > up when I tried to type this in to the Macro.
    >
    > It is sorted now.
    >
    > Many thanks for all your help.
    >
    > Andy
    >
    >
    > --
    > andyiain
    > ------------------------------------------------------------------------
    > andyiain's Profile: http://www.excelforum.com/member.php...fo&userid=8335
    > View this thread: http://www.excelforum.com/showthread...hreadid=552698
    >
    >


+ 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