+ Reply to Thread
Results 1 to 7 of 7

Rename Sheets by using Dynamic Loop for the rows

  1. #1
    Registered User
    Join Date
    12-18-2013
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    24

    Rename Sheets by using Dynamic Loop for the rows

    Hello everyone,

    I got the following problem. In column C I got some data like this:
    Number of .csv
    01
    02
    03
    04

    Number of .csv
    05
    06
    07
    08

    Notice that there is an empty cell in between.The data starts at C12 up to C21. The data is in Sheet2.There are also 8 more sheets( Sheet3 to Sheet10). I want to rename each sheet, starting from Sheet3 according to each cell. For example the Sheet3 to be renamed to 01, Sheet4 to 02.

    What I can do is something like this:
    Please Login or Register  to view this content.
    And repeat this code for every block of data I got by changing everytime the i and the a. But this method is not so optimized because there are cases that the number of rows for each block is not the same and I have to change everytime the i counter. Is there any way to do 1 loop for all the sheets using maybe Worksheets.Count and another dynamic loop for the rows ? The data always start every 6 rows eg( C12, C18 etc). Also I was thinking to define an integer representing the number of rows for the loop...

    Any help is appreciated,
    Thank you in advance

  2. #2
    Registered User
    Join Date
    12-18-2013
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Rename Sheets by using Dynamic Loop for the rows

    I tried to do this
    Please Login or Register  to view this content.
    But it does the renaming only for the first 2 values 01 and 02 and I don't know why...

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Rename Sheets by using Dynamic Loop for the rows

    What value is in C14?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  4. #4
    Registered User
    Join Date
    12-18-2013
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Rename Sheets by using Dynamic Loop for the rows

    Thanks for your reply. I got this :
    Number of .csv
    01
    02
    03
    04

    Number of .csv
    05
    06
    07
    08

    Starting from C12 so C14 has the value 03

  5. #5
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Rename Sheets by using Dynamic Loop for the rows

    Perhaps it is simply that a different sheet is active then Sheet2? You may try:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-18-2013
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Rename Sheets by using Dynamic Loop for the rows

    Yes it works, thank you very much

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Rename Sheets by using Dynamic Loop for the rows

    You are welcome.

+ 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. Transfer Rows to Other Sheets using a loop
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2013, 04:31 AM
  2. VBA - Copy and Rename New Sheets from List - Loop until complete
    By rskinner1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2013, 07:11 AM
  3. Dynamic Columns and Rows Selecting all Loop
    By excel0831 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2012, 05:41 PM
  4. Pull dynamic rows from several sheets into one
    By JordanA in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-20-2011, 11:29 AM
  5. Delete rows in multiple sheets without loop?
    By MTT727 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2005, 10:05 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