Results 1 to 3 of 3

"Worksheets("Seqnum").Visible = xlSheetVisible" not working

This is a discussion on "Worksheets("Seqnum").Visible = xlSheetVisible" not working within the Excel Questions forums, part of the Question Forums category; Having probs with code that did work and now doesn't... ' Open New form and increment serial number by 1 ...

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    34

    Default

    Having probs with code that did work and now doesn't...

    ' Open New form and increment serial number by 1

    INITIALISE

    Sheets("Seqnum").Unprotect
    Worksheets("Seqnum").Visible = xlSheetVisible
    Application.ScreenUpdating = False

    Sheets("Seqnum").Select
    Range("A1").Select
    Selection.copy

    The bit with:

    Worksheets("Seqnum").Visible = xlSheetVisible

    is causing the problem, but I don't think anything has changed. Can anyone offer any ideas?

    Thanks

  2. #2
    Board Regular s-o-s's Avatar
    Join Date
    Apr 2002
    Location
    Kissimmee, Florida
    Posts
    384

    Default

    On 2002-07-11 04:51, matthewh wrote:
    Having probs with code that did work and now doesn't...

    ' Open New form and increment serial number by 1

    INITIALISE

    Sheets("Seqnum").Unprotect
    Worksheets("Seqnum").Visible = xlSheetVisible
    Application.ScreenUpdating = False

    Sheets("Seqnum").Select
    Range("A1").Select
    Selection.copy

    The bit with:

    Worksheets("Seqnum").Visible = xlSheetVisible

    is causing the problem, but I don't think anything has changed. Can anyone offer any ideas?

    Thanks
    Try replacing with

    Code:
     Worksheets("Seqnum").Visible = True
    Hope This Helps.
    Sean.
    Digest of Homes

    WinXP, XL XP

  3. #3
    Banned
    Join Date
    Feb 2002
    Posts
    1,582

    Default

    Hi matthewh


    The use of: xlSheetVisible is quite ok. Not sure what your aim is but you need not unhide a sheet to copy from it, or even unprotect it.

    Code:
    Sheets("Seqnum").Range("A1").Copy _
    Destination:=Sheets("Sheet1").Range("A1")
    Will work the same as:

    Code:
    With Sheets("Seqnum")
          .Unprotect
          .Visible = xlSheetVisible
          .Range("A1").Copy Destination:=Sheets("Sheet1").Range("A1")
    End With

    Just make sure that the Workbook is not protected for Structure, Tools>Protection>Workbook

    _________________
    Kind Regards
    Dave Hawley
    8 Add-ins in one
    Forty+ more here
    OzGrid.com

    [ This Message was edited by: Dave Hawley on 2002-07-11 05:27 ]

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
  •  


DMCA.com