+ Reply to Thread
Results 1 to 2 of 2

Combining 2 codes for crtl z

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,750

    Combining 2 codes for crtl z

    Hi
    I am not sure if this is correct. Before I have combine this code, the code was working.

    This is the original which working after I mixed everything together.

    Before:
    Sub ctrlz()
    SendKeys "^z"
    End Sub
    After: Not working.

    Sub ctrlz()
    Sheets("Sheet1").Unprotect "Password"
    
    SendKeys "^z"
    
    With Sheets("Sheet1")
        .Protect _
            Password:="Password", _
            DrawingObjects:=True, _
            Contents:=True, _
            Scenarios:=True, _
            AllowFormattingCells:=True, _
            AllowSorting:=True
        .EnableSelection = xlUnlockedCells
    End With
    
    End Sub
    Thank you

  2. #2
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,750

    Re: Combining 2 codes for crtl z

    Here is the worksheet

    thank you for
    Attached Files Attached Files

+ 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] Combining two VBA codes into one
    By adboy14 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2023, 09:53 AM
  2. Combining two codes into one
    By Aqmas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2017, 03:46 PM
  3. Combining 2 codes into 1.
    By mullet40 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2016, 01:31 PM
  4. Call Two Codes from ComboBox
    By zplugger in forum Excel General
    Replies: 2
    Last Post: 01-24-2015, 03:02 PM
  5. Combining vba codes makes the previous codes broken !
    By MDPLUS in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-26-2013, 10:00 AM
  6. [SOLVED] Help! combining 2 VBA codes
    By iamreese in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-29-2012, 07:24 AM
  7. [SOLVED] combining 2 codes
    By steve in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2006, 01:15 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