Results 1 to 3 of 3

How to apply VBA in every row

Threaded View

  1. #1
    Registered User
    Join Date
    01-30-2016
    Location
    DUBAI
    MS-Off Ver
    OFFICE 365
    Posts
    1

    How to apply VBA in every row

    Hi All,

    im trying to make some sort of a daily report where in column "R" has a drop down list of its status.

    i.e. in row 6.
    once the work is finished, the staff will choose "COMPLETED" in column R6.
    What i would like to happen is that whenever they chose that word, selected cells in row6 will be locked or protected.

    i've manage to create VBA but it only applies to row6 only. would like apply the same rule in every row.

    please advise.. VBA i created is here...

    ----------------------------------------------------------------------------
    Private Sub Worksheet_Change(ByVal Target As Range)
         
        ActiveSheet.Unprotect Password:="11123"
         
        If Range("R6") = "COMPLETED" Then
            Range("B6:Q6").Locked = True
            Range("S6:T6").Locked = True
        Else
            Range("B6:Q6").Locked = False
            Range("S6:T6").Locked = False
        End If
         
        ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="11123"
         
    End Sub
    ---------------------------------------------------------------------------------------------

    Thank you in Advance !!!
    Last edited by Richard Buttrey; 01-30-2016 at 08:32 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Apply Macro First UnprotectSheet After Apply Macro ProtectAgain Solved by : Sixthsense
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2014, 05:32 AM
  2. How do i apply...
    By banny85 in forum Excel General
    Replies: 1
    Last Post: 06-22-2011, 12:30 PM
  3. anyone know how to apply for a job
    By Cheeky Charlie in forum The Water Cooler
    Replies: 6
    Last Post: 01-30-2009, 05:37 AM
  4. Does an if then apply here?
    By loc066 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2008, 09:16 PM
  5. How to apply a weighting
    By Homer J in forum Excel General
    Replies: 0
    Last Post: 08-12-2005, 05:05 AM
  6. Apply all autofilters
    By malcomio in forum Excel General
    Replies: 1
    Last Post: 07-29-2005, 10:05 AM
  7. [SOLVED] How can I apply this calculation
    By Rory in forum Excel General
    Replies: 4
    Last Post: 07-26-2005, 03:05 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