+ Reply to Thread
Results 1 to 18 of 18

A macros that will repeat a sheet. The row number will change in the formula each new shee

  1. #1
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    A macros that will repeat a sheet. The row number will change in the formula each new shee

    Hey guys,
    I think I got the basics of a macros down. What I'm wanting to know how to do, or if it can be done is repeat a sheet over and over many times. Let's say the formula in Sheet1 cell B5 is ='Sheet25'N23. (That's probably not the correct formula, but,,,). What I need to do is for Sheet 2 cell B5 to have that same formula, but, I need it to change the row number in the formula to N22. Each new sheet I make will go up a row in N. Sheet 3 will use N21 and so on.


    Is this something that is terribly hard to do? If it is a VBA thing only, let's just forget about it. I don't want anyone to put a lot of time into it. If it is something easy or not too hard to explain, I'd like to learn how to do it.


    Thank you all so much!!!!!

  2. #2
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    I'm looking around and found this...

    ActiveCell.FormulaR1C1 = "=RC[-2]"

    Is this something that can be done to do what I need. I just need the cell reference to change is all. I'm not sure what this formula is, or how to use it though if it is a way to do what I'm asking.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,540

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    See what happens if you try this on a copy of your workbook.
    And yes, it is a VBA thingy but you're welcome to try it.


    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    Thanks jolivanes!!! I'll see what it does. And if this works like I need, do I just put this in a different module with a different cell number and all that. I really don't know the first thing about VBA. I'll try it though and thank you very much for looking at this for me!!!

  5. #5
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    That would do it if I had enough sense to know how to change the cell reference. Which is actually in a whole different book. I just can't get the hang of the VBA quite yet.

    I've got the code, but will have to play around with it to figure out how to even start changing it to the cells I need to get the data from.

    Thank you a bunch jolivanes!!! I'll keep trying with it. That did work, but I'm just no where near able to know how to use it right.

  6. #6
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    Ok, I think I have a way to make that work and can possibly make it work. I just don't know enough about how it works. Would I need to put that in a module for every cell I needed to do that in? Like I said, I know nothing when it comes to this part of excel. Just barely writing formulas here.

    Is there a way, with a macros that I can type in the formula -1 or something that will allow me to subtract from the row number each time? That anyone knows of. I don't know the best way to go about it. I have to make it do this for about 100 cells on each sheet, so by hand is going to take a really long time to do the way I'd like to. If that's what I gotta do, then that's what I gotta do.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,540

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    Some pertinent information would be very helpful.
    If you can give us the exact no of sheets, which cells, which sheet the formula should reference etc etc.
    It is pretty hard to have too much information, as long as it makes sense to us. Remember, you are working on and looking at your workbook, we just go by what you are writing down here.
    Or better yet, attach a representative workbook with a before and after.
    Last edited by jolivanes; 04-15-2013 at 01:25 AM.

  8. #8
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    Well, each sheet has about 100 cells that have just an =(book-sheet-cellnumber) formula in it that come from 4 different books is what makes this such a pain. I guess the best way to start it would be for me to copy all the columns that has my data into a sheet in the book all this goes into and hide it. Then I can probably figure out how to make the code you wrote work. I don't want anyone having to go thru and write something for everyone of them. It's not important enough to put one of you thru that much time. I just didn't know if I changed that code and put it in a module for each cell, with my reference number and all that in it.

    What I'm looking for is what you wrote, but I need to do it many times per sheet. It's always the same column numbers per sheet, just the row number is what I need to change. I'll try it by getting all my data into one book, then using your code for each one. I'll work with it a while and see what I can do with it. That way there won't be any of you having to do put a lot of time into it.

    I'm probably in over my head on this one.

  9. #9
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    I'm making a sheet that I'll upload and you can all see what I'm up against. Then you can tell me what's the best way to go about it. It'll take me a minute to finish it. If it's a bunch of code writing though, I really don't want anyone to put that much time into it.

  10. #10
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    Ok, now if it's a lot of trouble, just leave it.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    What I'm needing is to repeat this over about 300 sheets. 100 if 300 is too many. I got tons of memory and plenty of drive space as far as all that goes.

    Column A's cells will go up a row towards the top with each sheet. They're on 491 no, so the next sheet will be 490 and so on. Same with L and W.

    C thru F, N thru Q and Y thru AB are the only other columns I need to change each sheet. The rest is the same sheet after sheet.

    If there is a way that isn't too much trouble, that would be great. If not, that's ok to.

    And thank you all that is even considering looking at what I need to do!!!!

  12. #12
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,540

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    It is well past my bedtime and tomorrow (today!) I will be busy so I hope someone will come with an answer for you.
    How big (KB) is your workbook going to be with 300 sheets like the sheet in your attachment?

  13. #13
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    Bedtime , yes. Well, I don't know how big it would be. It doesn't have to be that big. I can make copies of the book for different sections if I have to no problem if that many is a problem. As far as space on my PC, I'm running 4 drives with a shadow backup, and still got tons of memory to carry it. I'm just looking for a way to speed up the making process.

    Thank you very much for looking at it for me and hope you have a great, what's left of the night!!!

  14. #14
    Forum Contributor
    Join Date
    03-31-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    We're you able to come up with a macro for this? I'm friends with Greenfox and I think he is on a sabbatical for a spell lol
    Last edited by Larbec; 05-06-2013 at 04:31 PM.

  15. #15
    Forum Contributor
    Join Date
    03-31-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    Has anyone had time to look at what i am needing? I was wondering if the "indirect function" would work? I am a newby with excel and any help is appreciated

  16. #16
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    This thread was created by greenfox. Its better you create your own thread for this question.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  17. #17
    Forum Contributor
    Join Date
    03-31-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    Greenfox and i are working on this. Doesn't seem like anyone knows how to do what we are asking Will it benefit to start a new post ?

  18. #18
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: A macros that will repeat a sheet. The row number will change in the formula each new

    You can bump it up and you can even send a PM to the users helping you incase they would like to assist further.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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