+ Reply to Thread
Results 1 to 3 of 3

End If Without Block If Issue

Hybrid View

  1. #1
    Registered User
    Join Date
    01-11-2021
    Location
    Cleveland
    MS-Off Ver
    10
    Posts
    63

    End If Without Block If Issue

    Private Sub Workbook_Open()
    With ActiveSheet
    .Unprotect “Chief2"
     End If
    Worksheets("Sheet2").Activate
    Range("A1").Select
    Range("B16").Activate
    
    If Target.Address = "$B$16" Then
            Call Reset_Year
      End If
    .Protect  "Chief2"
    End With
    End Sub
    
    MACRO
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim i As Long
        Range("B16") = InputBox("Type in the new value for Range(""B16"")")
        Sheets("BEGIN YEAR").Range("C10") = Sheets("26").Range("N28").Value    'Total Remaining Vacation (Days)
        Sheets("BEGIN YEAR").Range("C11") = Sheets("26").Range("N29").Value    'Total Remaining Sick Leave (Days)
        For i = 1 To 26
            If i <= 9 Then
                With Sheets("0" & i)
                    Union(.Range("B18:O22"), .Range("C33:C36"), .Range("C28:C29")).CLEARCONTENTS
                End With
            Else
                With Sheets(i)
                    Union(.Range("B18:O22"), .Range("C33:C36"), .Range("C28:C29")).CLEARCONTENTS
                End With
            End If
        Next
    End Sub
    Attached Files Attached Files
    Last edited by ffbaker81; 12-20-2021 at 02:46 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,631

    Re: End If Without Block If Issue

    nevermind...
    Ben Van Johnson

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,127

    Re: End If Without Block If Issue

    Delete the first End If in the Open event.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] WorksheetFunction Using Date issue - (writers block)
    By PFDave in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2017, 04:42 AM
  2. [SOLVED] Issue: SUCURI firewall block
    By Sam Capricci in forum Suggestions for Improvement
    Replies: 8
    Last Post: 03-29-2017, 12:36 PM
  3. object Variable or With Block Variable Not Set Issue
    By skate1991 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2017, 07:09 AM
  4. Macro issue: Object variable or with block variable not set error
    By utgjmb1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-29-2013, 06:07 AM
  5. Replies: 1
    Last Post: 07-24-2013, 02:45 PM
  6. Replies: 5
    Last Post: 10-09-2012, 10:44 AM
  7. Replies: 2
    Last Post: 06-22-2010, 07:55 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