+ Reply to Thread
Results 1 to 5 of 5

Excel vba - Loop thru a dynamic range, Find value does not go beyond second found value.

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2007
    Posts
    39

    Excel vba - Loop thru a dynamic range, Find value does not go beyond second found value.

    Hi,
    I have a range of cells in a column which changes with new data.
    Code selects the range to last cell in column with value +1.

    Some of the cells in the range SUM the totals of the cells above (number of cells vary from 1 to many rows).

    Code then finds first cell with "Sum" in formula, offsets to cell on left and inserts formula.
    Loops back to do second pass.
    That works fine.
    Selects next Cell with "Sum" in Formula,offsets to cell on left and inserts formula.
    That works fine.
    Up to here there is no issue.
    From here on though I cannot get the code to move down to the next "Sum" (there may be many) until the last cell in the Range (that was selected in the first place).

    Clearly I have a syntax error and some missing code requirement!

    Can anyone help?

    Here is the code I have so far :

    Please Login or Register  to view this content.
    Last edited by Trompie; 04-02-2014 at 10:15 PM. Reason: Forum rule 7

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Excel vba - Loop thru a dynamic range, Find value does not go beyond second found valu

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-17-2012
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Excel vba - Loop thru a dynamic range, Find value does not go beyond second found valu

    Apologies!
    Code amended

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Excel vba - Loop thru a dynamic range, Find value does not go beyond second found valu

    Try this...

    Please Login or Register  to view this content.
    This link is a good guide for the .Find method.
    The ultimate search
    Last edited by AlphaFrog; 04-02-2014 at 10:51 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  5. #5
    Registered User
    Join Date
    05-17-2012
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Excel vba - Loop thru a dynamic range, Find value does not go beyond second found valu

    Absolutely marvellous!!
    And very simple too.
    Appreciate the time and the result - Thank You.

+ 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. loop to find integers and decimals and pass found row to bookmark code.
    By beenbee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2014, 08:00 AM
  2. Loop through Column to find decimal then pass found row to bookmark code
    By beenbee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2014, 11:13 AM
  3. [SOLVED] nested loop for copying range: error no cells were found
    By Edejager in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-09-2013, 08:52 AM
  4. Dynamic Range using Offset, range not found for Pivot
    By GoneBaja in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-08-2012, 09:19 AM
  5. How to exit a loop once the value is found in the range
    By Suety in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2010, 01:30 PM

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