+ Reply to Thread
Results 1 to 6 of 6

VBA Code Required to autofill formulated column according to the adjacent column

Hybrid View

  1. #1
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    VBA Code Required to autofill formulated column according to the adjacent column

    Hi Team,

    I have values in suppose column A (can be upto any row number) and there is a formula in B2.

    Can you help me with a code that would count the rows in Column A and then would autofill B2 upto the last row adjacent to column A??

    I hope I was able to frame my query completely.




    Thanks,

    Bonny Tycoon

  2. #2
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: VBA Code Required to autofill formulated column according to the adjacent column

    I understand the code to count column A

    Dim Rws As Long, Rng As Range
    Rws = Cells(Rows.Count, "A").End(xlUp).Row
    Set Rng = Range(Cells(1, 1), Cells(Rws, 1))
    But then how should I get Column B autofilled till that range??



    Thanks,

    Bonny Tycoon

  3. #3
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: VBA Code Required to autofill formulated column according to the adjacent column

    hey JosephP,

    Thanks mate.. To tell You thats wht I got..

    I cant rep myself for finding it out.. BUt glad to see a similar response.. You deserve some rep. .., Here you get it...





    Thanks,

    Bonny Tycoon

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA Code Required to autofill formulated column according to the adjacent column

    Range("B2:B" & Cells(Rows.Count, "A").End(xlUp).Row).FillDown
    oughta do it.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: VBA Code Required to autofill formulated column according to the adjacent column

    I tried on my own and got the required code and output.

    Closing Thread..



    Thanks,

    Bonny Tycoon

  6. #6
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: VBA Code Required to autofill formulated column according to the adjacent column

    Hey Josephp,

    I had another one too


        Dim LastRow As Long
        LastRow = Cells(Rows.Count, "A").End(xlUp).Row
        Range("B2").AutoFill Destination:=Range("B2:B" & LastRow)

    Thanks,

    Bonny Tycoon


    **If I was able to help please click the small star icon at the bottom left of my post **

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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