+ Reply to Thread
Results 1 to 3 of 3

Apply the same macro on ALL sheets

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    philippines
    MS-Off Ver
    Excel 2003/Excel2007
    Posts
    31

    Apply the same macro on ALL sheets

    (I know this is easy, or have been asked before, please bear with me)....suppose I have the ff in sheet1:

    A B
    1 (data) (display time the data was pasted/posted)
    2
    3
    .
    .
    .

    this is my macro:
    Private Sub worksheet_change(ByVal Target As Range)
    If Target.Column = 1 Then
    Application.EnableEvents = False
    Cells(Target.Row, 2).Value = Time
    Application.EnableEvents = True
    ProtectCellsInB
    End If
    End Sub

    How will I be able to do the same steps in ALL sheets? (aside from typing the same macro in ALL sheets)

    TIA
    Last edited by lab_harts; 12-17-2014 at 12:08 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Apply the same macro on ALL sheets

    Try the ThisWorkbook Module.

  3. #3
    Registered User
    Join Date
    07-16-2012
    Location
    philippines
    MS-Off Ver
    Excel 2003/Excel2007
    Posts
    31

    Re: Apply the same macro on ALL sheets

    thanks for the quick response

+ 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. Replies: 2
    Last Post: 09-19-2013, 04:22 AM
  2. [SOLVED] Macro to Unprotect sheets-unlock range of cells-protect sheets
    By jrace in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2013, 10:45 AM
  3. Creating a macro to print only the sheets and portion of sheets that i select.
    By cadamhill in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2012, 01:48 PM
  4. Replies: 0
    Last Post: 10-10-2012, 08:56 AM
  5. [SOLVED] Macro for filter on protected workbook that works for all sheets, no matter what sheets are named?
    By StargateFanFromWork in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-26-2006, 02:35 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