Results 1 to 2 of 2

Vba to add new worksheet when range changes.

Threaded View

  1. #1
    Registered User
    Join Date
    06-09-2014
    Posts
    1

    Unhappy Vba to add new worksheet when range changes.

    I am a bit familiar with macros but I am struggling. I have a code that copy a template and rename based on a range in a sheet call master.
    However, I want to update it such that when new names excluding empty cells are included in the range, automatically searches all the worksheets and the create a new template and rename based the cell value.

    Below is the code
    Sub ReName()
        Dim c As Range
        Set Sh = Sheets("Template")
        
        Application.ScreenUpdating = False
        With Sheets("Template")
            For Each c In .[EN]
                If c.Value <> "" Then
                Sheets("Master").Cells.Copy
                    .Copy After:=Sheets(Sheets.Count)
                    On Error Resume Next
                    ActiveSheet.Name = c.Value
                    On Error GoTo 0
                End If
            Next c
        End With
        Application.ScreenUpdating = True
    End Sub
    Last edited by templedream; 07-17-2014 at 08:22 AM. Reason: code tags added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Match Cell Range to Worksheet Name and copy/paste to respective worksheet
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2014, 04:06 PM
  2. Match Cell Value to Worksheet Name Then Copy/ Paste Range to Worksheet
    By matt2072 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2014, 01:23 PM
  3. Replies: 3
    Last Post: 09-08-2013, 06:38 PM
  4. Copy text from set range in one worksheet to named worksheet in another workbook
    By Steven811 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2013, 10:55 AM
  5. [SOLVED] Range Question / error 1004: method Range of object Worksheet has failed
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2005, 10: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