Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    STILL ON HIDE SHEET (2000 sr 1)

    Sub VER_DATA_TAB()


    Dim lngRow As Long
    Dim rngFind As Range
    Dim blnAllOk As Boolean
    Dim intIndex As Integer
    Dim strLast As String

    Worksheets("DB_AGENZIE").Visible = True
    Worksheets("DB_AGENZIE").Activate
    With Worksheets("DB_AGENZIE")

    strLast = Format(ActiveSheet.Range("K65536").End(xlUp).Value , "dd/mm/yyyy")

    ' controlla se la data del tabulato importare

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: STILL ON HIDE SHEET (2000 sr 1)

    There is no need to unhide then hide the worksheet DB_AGENZIE.

    "it not work correctly" doesn't tell us much. What is the problem?
    - Do you get an error message? If so, what does it say?
    - The code runs, but the result is not what you wanted? If so, what is the result, and in what way is it incorrect?
    - The code runs, but it does nothing.

    Please try to give specific information.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: STILL ON HIDE SHEET (2000 sr 1)

    Good morning.

    ok!

    If you see in the script i hide and un hide the sheet DB_AGENZIE to work.
    But the problem is the same to refer this last your suggestion:

    ================================================== =========
    To make the code work for a hidden worksheet, you must refer to it explicitly:

    Private Sub Workbook_Open()
    Dim lngRow As Long
    Dim d As Date
    Dim wsh As Worksheet
    Set wsh = Worksheets("DB AGENZIE")
    lngRow = wsh.Range("K65536").End(xlUp).Row
    d = CDate(wsh.Range("K" & lngRow)) + 1
    Do While d <= Date
    If Weekday(d) > 1 And Weekday(d) < 7 And IsHoliday(d) = False Then
    lngRow = lngRow + 1
    wsh.Range("K" & lngRow) = Format(d, "dd/mm/yy")
    End If
    d = d + 1
    Loop
    Set wsh = Nothing
    End Sub

    Modifications to the code are indicated in bold. Change the worksheet name if necessary.

    ================================================== ============

    in effect i want to run the script with explicitly range and mantain the sheet hide (is a sheet seriv

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: STILL ON HIDE SHEET (2000 sr 1)

    You're still not saying what the problem is. But your code doesn't refer to the DB_AGENZIE sheet consistently. Try this:
    <small>
    Sub VER_DATA_TAB()
    Dim lngRow As Long
    Dim rngFind As Range
    Dim blnAllOk As Boolean
    Dim intIndex As Integer
    Dim strLast As String

    With Worksheets("DB_AGENZIE")
    strLast = Format(.Range("K65536").End(xlUp).Value, "dd/mm/yyyy")

    ' controlla se la data del tabulato importare

Posting Permissions

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