+ Reply to Thread
Results 1 to 5 of 5

Automated sheets naming

  1. #1
    Registered User
    Join Date
    03-14-2016
    Location
    Warsaw
    MS-Off Ver
    2010
    Posts
    11

    Automated sheets naming

    Hi,

    my macro code:


    Please Login or Register  to view this content.
    Problem:
    Iname can't be understood by Sheets(iname).Select. As you can see I tried to add special signs to simply read correct name, but VBA don't get it.

    This code part is opening external file *.txt, which contains in column names, ie:
    WIERSZ1
    WIERSZ2
    WIERSZ3
    WIERSZ4
    ....

    I would like to add sheets which names are as in external file. My idea was to open this file, read rows, create sheets and rename them. After that I would read to those worksheets data from other files I have and which names are: WIERSZ1.csv, WIERSZ2.csv, WIERSZ3.csv... but just wondering if this code is not too sophisticated and if there's no easier way to achieve the same result in few lines.
    Thanks for help.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Automated sheets naming

    Iname can't be understood by Sheets(iname).Select.
    Because you never actually named a sheet iname. Try something like:

    Please Login or Register  to view this content.
    Or whatever you're trying to have the sheets be named.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    03-14-2016
    Location
    Warsaw
    MS-Off Ver
    2010
    Posts
    11

    Re: Automated sheets naming

    Quote Originally Posted by walruseggman View Post
    Because you never actually named a sheet iname. Try something like:

    Please Login or Register  to view this content.
    Or whatever you're trying to have the sheets be named.
    Now Excel see problem in After:=Sheets(Sheets.Count)

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Automated sheets naming

    My bad, should be in parenthesis:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-14-2016
    Location
    Warsaw
    MS-Off Ver
    2010
    Posts
    11

    Re: Automated sheets naming

    Quote Originally Posted by walruseggman View Post
    My bad, should be in parenthesis:

    Please Login or Register  to view this content.
    Thank you. I solve issue by making sheet with names active and then:

    Please Login or Register  to view this content.

+ 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. Need help with copying rows, replicating sheets, naming sheets and assigning print area...
    By Navin Agrawal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2014, 09:21 AM
  2. Automated Tab (Sheet) Naming
    By Hindsight81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2012, 02:50 PM
  3. Re-Naming Sheets per Cell data & Hiding Sheets
    By dej222 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2009, 10:20 PM
  4. The Naming of sheets
    By tuganne1 in forum Excel General
    Replies: 3
    Last Post: 04-30-2009, 05:48 PM
  5. Automated Exporting Sheets?
    By thomas.szwed in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2007, 07:44 AM
  6. Naming Sheets
    By Dallas6570 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-16-2007, 11:49 AM
  7. naming sheets
    By Christian Galbavy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2005, 06: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