Results 1 to 3 of 3

Wants to apply vba code to multiple cell

Threaded View

  1. #1
    Registered User
    Join Date
    07-19-2016
    Location
    Ahmedabad, India
    MS-Off Ver
    2013
    Posts
    3

    Question Wants to apply vba code to multiple cell

    I want to apply below vba code to cell range F11:F2000 and want to get result relatively

    please help

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target <> Range("F11") Then Exit Sub
    
    ActiveSheet.Unprotect ("Undo")
    
    If Range("F11").Value = "3" Then
    Range("G11").Value = ""
    Range("G11").Locked = True
    Range("H11").Locked = False
    Range("I11").Value = ""
    Range("I11").Locked = True
    End If
    
    If Range("F11").Value = "5" Then
    Range("G11").Locked = False
    Range("H11").Value = ""
    Range("H11").Locked = True
    Range("I11").Locked = False
    End If
    
    If Range("F11").Value = "7" Then
    Range("G11").Locked = False
    Range("H11").Locked = False
    Range("I11").Locked = False
    End If
    
    If Range("A1").Value = "" Then
    Range("B1").Locked = False
    Range("C1").Locked = False
    Range("D1").Locked = False
    End If
    
    ActiveSheet.Protect ("Undo")
    
    End Sub
    Last edited by alansidman; 07-19-2016 at 10:47 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Apply VBA code to multiple cells
    By rosenina18 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-14-2024, 08:07 AM
  2. Apply VBA code to multiple sheets
    By PaulusKabouter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2013, 11:37 AM
  3. Apply VBA code to multiple cells
    By jond291 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2013, 07:33 AM
  4. [SOLVED] Can i modify this code to apply to multiple checkboxes and sheets?
    By stolen_83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2013, 02:44 PM
  5. [SOLVED] Match code to apply multiple cells in 1 Sub
    By colvinb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2012, 06:38 AM
  6. Need to apply VBA code to multiple Worksheets
    By parteegolfer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2006, 04:43 PM

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