Consulting

Results 1 to 1 of 1

Thread: Add a worksheet based on cell content

  1. #1

    Add a worksheet based on cell content

    I have this code that will change the name of the worksheet as long as a worksheet is present.
    Private Sub Worksheet_Change(ByVal Target As Range)
        Set SensitiveRange = Range("A1:A8")
        Set myRange = Intersect(Target, SensitiveRange)
        If Not myRange Is Nothing Then
            For Each cll In myRange.Cells
                If IsEmpty(cll) Then
                    Sheets(cll.Row + 2).Name = Sheets(cll.Row + 2).CodeName
                Else
                    Sheets(cll.Row + 2).Name = cll.Value
                End If
            Next cll
        End If
    End Sub

    Can I expand this code to add a worksheet if text is entered on an empty cell between lines A1 thru A8.

    Attached is the workbook

    thanks in advance
    Attached Files Attached Files
    Last edited by RonNCmale; 10-01-2015 at 03:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •