Results 1 to 3 of 3

Applying Macro to all worksheets (tabs)

Threaded View

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Applying Macro to all worksheets (tabs)

    Hi,

    I have written a macro to sum column N in a specified worksheet. But I need the code to apply the macro to all the worksheets in my workbook.
    I have been searching how to do this to no avail. Can anyone help?

    Here is my code:

    Sub Sum()
    
    Dim LR As Long
    With Sheets("UNIVERSITY OF HELSINKI")
        LR = .Range("N" & Rows.Count).End(xlUp).Row
        .Range("N" & LR + 1).Value = WorksheetFunction.Sum(.Range("N1:N" & LR))
    End With
    End Sub
    Last edited by Cutter; 07-16-2012 at 12:13 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

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

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