+ Reply to Thread
Results 1 to 5 of 5

Loop add formula

  1. #1
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    164

    Loop add formula

    Hello All!

    I'm working on a worksheet activate triggered macro that will followin the below steps.
    1: Find the next blank cell in Column "BB"
    2: check if there is anything in the cell next to it in column "BA"
    3a: No - exit
    3b: Yes - copy the formula in the cell above (in column "BB") and paste it in the cell found in step 1
    4: Loop for as long as there is data in column "BA"

    Here is what I have so far, but obviously its not working.

    Please Login or Register  to view this content.
    Thanks in advance.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Loop add formula

    Perhaps this is the wrong solution to the wrong problem. So, people are adding values in column BA and you need the BB formula to be added automatically? My solution would be to make sure that formula is being added at the moment they enter those BA values.


    What is the formula in BA2?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: Loop add formula

    JBeaucaire: BA is in fact a formula -
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However, BA is the last column in a table, so when new line is added to the table the formula autogenerates. I don't want column BB to be apart of the tablefor a number of reasons, thus why I went with the above attempt.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Loop add formula

    Staying with worksheet_activate, then, all at once:

    Please Login or Register  to view this content.
    Or is there a different formula to add in BB?

  5. #5
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: Loop add formula

    Perfect! I tweaked it slightly, but this is exactly what I needed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Loop Formula
    By lashellr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2015, 12:09 AM
  2. [SOLVED] [VBA] Loop the Formula within the VBA
    By dylanrose in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2014, 06:37 AM
  3. [SOLVED] vba day formula ina for loop
    By Zealotwraith in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2013, 12:05 PM
  4. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  5. Loop & formula
    By dems in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-31-2010, 10:26 AM
  6. VBA Formula and Loop
    By ker9 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-27-2010, 12:38 PM
  7. Loop formula
    By ninja0059 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-04-2008, 03:46 PM

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