+ Reply to Thread
Results 1 to 12 of 12

Autofill formula every 105 rows, while repeating

  1. #1
    Registered User
    Join Date
    10-04-2018
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    5

    Autofill formula every 105 rows, while repeating

    Hello Everyone!

    This forum has been a lifesaver!

    I have an issue that i cannot find the resolution anywhere, i am hoping someone here can help!

    I have a spreadsheet that i am pulling data from another tab (='Retailers '!$C$3), on the "retailers" tab i have over 400 rows, and each row is a different retailer. On the sheet i am working on i want to pull that for each row but repeat 105 times. I have been filling and changing the row number manually, but if i have to do this over 400 times it will take forever, and i am sure there is an easy way to do this.

    I am going to give a little example here in a small scale

    TAB 1 (Source)

    Walmart
    Target
    Lowes

    TAB 2 (i will do repeat formula 2 times vs 105 to make it easy)


    ='TAB 1'!$A$1 (Walmart)
    ='TAB 1'!$A$1 (Walmart)
    ='TAB 1'!$A$2 (Target)
    ='TAB 1'!$A$2 (Target)
    ='TAB 1'!$A$3 (Lowes)
    ='TAB 1'!$A$3 (Lowes)

    Not sure if i was clear, hope i was. Thank You in advance!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Autofill formula every 105 rows, while repeating

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.


    To add a file to a post

  3. #3
    Registered User
    Join Date
    10-04-2018
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Autofill formula every 105 rows, while repeating

    I have now attached a example.

    The retailers tab on my original i have over 400 rows (i only included 4 in the sample), i need to pull each roll from the retailers tab 105 times, then on the 106 it comes the next one down the line and so on and so forth. I then have on the Sheet 1 a simple formulas pulling info using the retailer as a reference. The issue is i have users that may change the name or the way the name shows and it messes up my formula. I had previously done manually each row and dragging to 105 lines.

    Thank You so much!
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Autofill formula every 105 rows, while repeating

    As a simple example, this code goes through the retailers in Sheet1 from A1:A??? and for each retailer it generates the formula back to each one 105 times.

    A formula pointing to Sheet1!A1 will appear in Sheet2!A1:A105
    A formula pointing to Sheet1!A2 will appear in Sheet2!A106:A210
    etc...
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Autofill formula every 105 rows, while repeating

    Updated code to work with your sample workbook:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-04-2018
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Autofill formula every 105 rows, while repeating

    On the Retailers tab (source) i have 470 rows of data, each of those need to repeat 105 times. If possible i would like to not stop at line 470 in case the user adds new locations. I am hoping i was clear...

  7. #7
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Autofill formula every 105 rows, while repeating

    Each time you run the macro it will find the new last row, whether it's row 4 or 4000.

  8. #8
    Registered User
    Join Date
    10-04-2018
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Autofill formula every 105 rows, while repeating

    It is giving me an error "Out of Range" i have the data in the column C and i changed and still happened. Attached is the actual file, i need each of those "CStore Chain" on column C, to repeat 105 times on "Sheet 1"
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Autofill formula every 105 rows, while repeating

    Downloaded your file from post #8 above. A few things...
    1. Your "Retailers" worksheet is actually named "Retailers " (with a space at the end). That's why you're getting an 'Out of Range' error. Remove the trailing space.
    2. Your retailer list starts in C6 of that sheet, so I've adjusted the For...Next loop to span "C6:C" & ret instead of "C3:C" & ret
    3. I changed the 'Sheets("Sheet 2")' reference to 'Sheets("Sheet1")' since that's what your worksheets are named.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-04-2018
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    5

    Thumbs up Re: Autofill formula every 105 rows, while repeating

    It worked! Thank You so much!!!!!!

  11. #11
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Autofill formula every 105 rows, while repeating

    You're welcome!

  12. #12
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Autofill formula every 105 rows, while repeating

    ...oddly enough, the 'Reputation' boost you gave put me at exactly 105. What are the odds of that?

+ 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. Autofill a repeating alphnumeric series
    By Clutch Cargo in forum Excel General
    Replies: 0
    Last Post: 03-03-2015, 02:41 PM
  2. [SOLVED] Repeating sum formula every fourth block of rows
    By sjshah82 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-26-2013, 04:13 PM
  3. [SOLVED] The autofill option is repeating every cell twice...
    By theo_c in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 01:00 PM
  4. Autofill a pattern or repeating sequence
    By awcwa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 12:04 PM
  5. [SOLVED] Autofill formula down rows with skipping rows
    By vickybarda1 in forum Excel General
    Replies: 7
    Last Post: 08-28-2012, 11:52 AM
  6. creating a repeating formula that doesn't show repeating values
    By cybershot in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-09-2010, 06:12 PM
  7. AutoFill for Repeating Groups of Numbers
    By Jonezee1 in forum Excel General
    Replies: 2
    Last Post: 09-27-2008, 10:47 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