+ Reply to Thread
Results 1 to 2 of 2

Move Target Address Worksheet to the beginning.

  1. #1
    Registered User
    Join Date
    12-15-2011
    Location
    Dallas texas
    MS-Off Ver
    Excel 2010
    Posts
    45

    Move Target Address Worksheet to the beginning.

    I have been working on this for a while with no success. Originally we were looking for the active worksheet to move to the end so i got this code below to do exactly that. Now I dont need the active sheet to move to the end but need the target address worksheet to move to the beginning

    Note: the active sheet is sheet 1

    Any ideas how to get this to work.





    [Private Sub Worksheet_Change(ByVal Target As Range)

    Dim iLoop As Integer

    If Target.Address = "$C$17" Then
    If Target.Value < Worksheets.Count And Target.Value >= 1 Then
    'inivisible all sheets
    For iLoop = 2 To Worksheets.Count
    Worksheets(iLoop).Visible = True
    Next
    Worksheets(Target.Value + 1).Visible = True
    Worksheets.Copy
    Set wb = ActiveWorkbook
    ActiveWorkbook.SaveAs Range("C1").Value
    ActiveSheet.Move after:=Worksheets(Worksheets.Count)
    End If
    End If

    End Sub]

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Move Target Address Worksheet to the beginning.

    Hi mmctague,


    How about:
    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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