Consulting

Page 4 of 4 FirstFirst ... 2 3 4
Results 61 to 62 of 62

Thread: VBA Code to Match US Region to the State that is entered

  1. #61
    Hi,

    I found a funky thing... When I remove the Client Name it doesn't remove the color coding of the fields for required information.
    Quote Originally Posted by Paul_Hossler View Post
    1. I put the protect subs on mod_Util since you have to run them manually and added the CA-CL write capability, marked with <<< below so that you can change it

    Sub ProtectMDS()
    
        With Worksheets("MDS Equipment Detail")
            If .ProtectContents Then Exit Sub
            Range(.Rows(1), .Rows(6)).Locked = True
            Range("CA5").Resize(2, 16).Locked = False       '<<<<<<<<<<<<<<<<<<<
            Range(.Rows(7), .Rows(.Rows.Count)).Locked = False
            .Protect Password:="password", UserInterfaceOnly:=True, _
                DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingCells:=True, _
                AllowDeletingRows:=True, AllowFiltering:=True
            .EnableSelection = xlUnlockedCells
        End With
    End Sub
     
     
    Sub UnProtectMDS()
        With Worksheets("MDS Equipment Detail")
            If Not .ProtectContents Then Exit Sub
            .Unprotect Password:="password"
        End With
    End Sub
    2. You must have changed the layout of MOST so the header row was wrong

    Public Const rowHeaderMOST As Long = 4
    Public Const rowDataStartMOST As Long = 5

    3. I changed the logic to not use the UsedRange on MDS but only down to the last row that has a Client

  2. #62
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    I think it clears the 'Required Data' except if the last client was the one deleted
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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