+ Reply to Thread
Results 1 to 14 of 14

Macro or formula to fill in next number in series

  1. #1
    Forum Contributor
    Join Date
    06-13-2012
    Location
    ND
    MS-Off Ver
    Excel 2010
    Posts
    152

    Macro or formula to fill in next number in series

    I am looking to fill in the blanks with the next series of the number for column B - Customer Material Number.

    For example -
    Line 1089 - 1702 43 05 ALT4
    Line 1090 - 1702 43 05 ALT5

    The spreadsheet is sorted on...
    Level 1 - SearchTerm
    Level 2 - Customer Material Number
    This aligned column B's blanks to filter after the number series.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-13-2012
    Location
    ND
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Macro or formula to fill in next number in series

    Please Login or Register  to view this content.
    I found the above code. I tried to change "A" to "B" but it didn't work. I am guessing I need to change the .value line.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro or formula to fill in next number in series

    If you are simply trying to fill up with the above number, no need for a code, use excel function called go to.

  4. #4
    Forum Contributor
    Join Date
    06-13-2012
    Location
    ND
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Macro or formula to fill in next number in series

    I need a number added to the number above.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro or formula to fill in next number in series

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-13-2012
    Location
    ND
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Macro or formula to fill in next number in series

    That macro does not add +1 to the previous record. Also, the macro should only add a number to ALT. MFG Obsolete and removed from standards should be ignored.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro or formula to fill in next number in series

    I have only adjusted some of the error lines and did not look at the last line

  8. #8
    Forum Contributor
    Join Date
    06-13-2012
    Location
    ND
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Macro or formula to fill in next number in series

    I am getting an error on the last line and it is not adding 1. I am trying to break down the last line...but not getting anywhere.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro or formula to fill in next number in series

    I did not get any error, but the code will not work if you put conditions. It indiscriminately apply the formal while you want to exclude some rows, so a loop would be the solution.

  10. #10
    Forum Contributor
    Join Date
    06-13-2012
    Location
    ND
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Macro or formula to fill in next number in series

    I am first sorting on SearchTerm then on Customer Material Number (A to Z)
    Then I ran the macro and I get a runtime error. Pictures are posted errors.

    What am I doing wrong?

    Also, the series is still not adding +1 to the previous number.
    Attached Images Attached Images

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro or formula to fill in next number in series

    Look at the attached. I have left the original as it is, copied it and used the code. The code works as per formal. Compare both sheets.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    06-13-2012
    Location
    ND
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Macro or formula to fill in next number in series

    The macro is not working...

    Line 1204 should be 1705 58 00 ALT 7 (because the last record in the group 1705 58 00 (searchterm) is ALT 6
    Line 1205 should be 1705 58 00 ALT 8

    ...this is the result the macro gave.
    1705 58 00 478303304
    1705 58 00 478303304

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro or formula to fill in next number in series

    The macro is not working is not the same as you are getting errors.
    You are the one who came up with formula. You know what you wanted. I have only corrected the error lines.
    The code does not search anything, it copies the row above if a cell is blank in column B. There is no exception to any cell.
    It applies to entire column B.
    If you want to exclude certain rows, you need to loop through the rows, the code you have does not loop thorough.

  14. #14
    Forum Contributor
    Join Date
    06-13-2012
    Location
    ND
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Macro or formula to fill in next number in series

    I copied and pasted the formula and noted that the value line probably needed to be changed. I am writing on this thread because I don't know how to write that script.

+ 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. auto fill series number formula
    By corescript in forum Excel General
    Replies: 2
    Last Post: 09-23-2012, 05:57 AM
  2. Fill roman number series
    By Caines87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2011, 12:11 PM
  3. Number series fill down within a formula
    By jhc8255 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2010, 09:54 PM
  4. Replies: 5
    Last Post: 06-12-2008, 12:39 PM
  5. How do I increment a fill series by a number other than 1? Say I.
    By John in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-07-2005, 09:06 AM

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