+ Reply to Thread
Results 1 to 12 of 12

Auto Rows Number

  1. #1
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Auto Rows Number

    I have attached a file
    I want to auto generate Row Numbers R=1 to 180 max
    Then, another 2 Rows, which Shift Row R, Up and Down, by S=0 to 12 max
    Example : R=9, S=4

    Rows Up Down
    1 5 6
    2 6 7
    3 7 8
    4 8 9
    5 9 1
    6 1 2
    7 2 3
    8 3 4
    9 4 5
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Auto Rows Number

    Hi ionelz,

    I'm not sure this is exactly what you want, as I don't understand the "up down". See if you can work with this file.

    Auto Rows Number.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Auto Rows Number

    Horizontal is easy to explain
    1 2 3 4 5 6 7 8 9
    Shift Right 4, mean 6 7 8 9 1 2 3 4 5
    4 number are pushed out to right
    1 shift 4 to right which push 6 7 8 9 at beginning
    It is a CIRCLE, at end of 9 is 1
    Shift Left 4, mean 5 6 7 8 9 1 2 3 4
    4 numbers, 1 2 3 4 is pushed out to left.....
    Last edited by ionelz; 02-16-2019 at 09:39 PM.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Auto Rows Number

    Yep,

    Seems like you need the Mod() function with some combination of plus or minus your shift number. See my example and work on the starting number in row 2.

  5. #5
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Auto Rows Number

    file attached again, with new condition
    Attached Files Attached Files

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Auto Rows Number

    Hi ionelz,

    Find the attached with the same formulas as post #2. This solves your problem. Change the R and S numbers and see it work like you want.

    Mod Up Down.xlsx

  7. #7
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Auto Rows Number

    First, I want auto generate row numbers, from 1 to B4
    Otherwise, 24 is always there
    If B4=50 ?

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Auto Rows Number

    Hi ionelz,

    I must be missing something. I thought my answer was really good and exactly what you asked for. I though I was given the row numbers. See my first file in post 2 where I have a formula for Row numbers. I think it was =Row()-1 . Then I pulled that formula down as many rows as you needed. Doesn't this solve your question?

  9. #9
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Auto Rows Number

    I may not explained well.
    I need to have DYNAMIC number of Rows.
    I will drag the formula for rows to max 180 ( I will protect for that space) but I need to show ONLY R rows
    Then I want to Shift them, Up and Down, per post #5

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Auto Rows Number

    Will you allow VBA to create the first column? Can you give an example of how your steps are created and what you get first and then what is to be done from there?

    I guess I'm just dense in what you are trying to solve/accomplish with a Dynamic number of rows. I don't see why you can't just pull down the correct number in column A in the beginning.

    Sorry I'm not getting it....

    Marv

  11. #11
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Auto Rows Number

    A3 =24
    A4 =6

    Please try
    E2
    =IF(D3>$A$3,"",MOD($D3+$A$4-1,$A$3)+1)
    F2
    =IF(E3>$A$3,"",MOD($D3-$A$4-1,$A$3)+1)

    Drag E2:F2 down
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Auto Rows Number

    Of course, like always !
    Done !
    Thank you again !

+ 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] Auto Fill X rows down depending on Number of rows in a table
    By MarkSe in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-24-2017, 02:20 AM
  2. [SOLVED] code to auto number rows - that will update when rows are added/deleted
    By dkitzerow in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-12-2015, 10:45 AM
  3. Auto-number when inserting rows
    By wedzmer in forum Excel General
    Replies: 10
    Last Post: 05-19-2015, 09:28 AM
  4. Repeat Auto Number in Rows through VB
    By AmirSoft in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-21-2014, 05:16 AM
  5. Replies: 0
    Last Post: 03-06-2013, 05:44 PM
  6. Auto calculate new number of rows
    By bill22 in forum Excel General
    Replies: 4
    Last Post: 06-11-2012, 06:38 AM
  7. [SOLVED] Auto insert a number of rows
    By Gar3th in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2005, 10:06 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