+ Reply to Thread
Results 1 to 5 of 5

VBA Copy Formula down a column until last non empty cell

  1. #1
    Registered User
    Join Date
    04-14-2013
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2010
    Posts
    34

    VBA Copy Formula down a column until last non empty cell

    Good Afternoon,

    I have created a macro that inserts a column (B) and in the first row I have placed a Formula. It takes the 4th element from a string from column A. I need to copy this macro down column B until there is no data in row A. I have no clue how to write the VBA code for this. Can someone please help me?

    Thank you,

  2. #2
    Registered User
    Join Date
    04-14-2013
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: VBA Copy Formula down a column until last non empty cell

    This is what my code looks like so far:

    Sheets("1358").Select
    Columns("B:B").Select
    Selection.Insert Shift:=x1ToRight, CopyOrigin:=x1FormatFromLeftorAbove
    Range("b4").Select
    ActiveCell.FormulaR1C1 = "=MID(RC[-1],10,4)"
    Range("B5").Select

  3. #3
    Registered User
    Join Date
    01-01-2005
    MS-Off Ver
    2007
    Posts
    368

    Re: VBA Copy Formula down a column until last non empty cell

    Hi Jeannie,

    Put this code in a module. The formula will be entered from cell B2 until B...

    Please Login or Register  to view this content.
    Regards,
    Elio Fernandes
    Last edited by efernandes67; 05-04-2013 at 09:34 AM.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: VBA Copy Formula down a column until last non empty cell

    Hi, Elio Fernandes,

    shouldn´t it be
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  5. #5
    Registered User
    Join Date
    01-01-2005
    MS-Off Ver
    2007
    Posts
    368

    Re: VBA Copy Formula down a column until last non empty cell

    Holger,

    I agree with you.

    Regards,
    Elio Fernandes

+ 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