+ Reply to Thread
Results 1 to 4 of 4

Need Macro help to exclude one worksheet

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Need Macro help to exclude one worksheet

    Hey guys;

    I have the following macro that pulls data from all worksheets and pastes into a master worksheet. It works great, however I have one worksheet that I do not want this macro to copy from. How do I exclude this one worksheet?

    Sub Merge()
    Dim ws As Worksheet
    ActiveSheet.UsedRange.Offset(0).Clear
    For Each ws In ActiveWorkbook.Worksheets
    If ws.Name <> ActiveSheet.Name Then
    ws.UsedRange.Offset(4).Copy
    With Range("A65536").End(xlUp).Offset(1, 0)
    .PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    .PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    End With
    End If
    Next
    End Sub

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,844

    Re: Need Macro help to exclude one worksheet

    Try the following. Replace ("WorkSheetToIgnore") with the name of your sheet. Please use code tags when posting any code.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-31-2013
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Need Macro help to exclude one worksheet

    I recieved the following error when trying to complete this:

    Untitled.png

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,844

    Re: Need Macro help to exclude one worksheet

    Could you post a copy of your file including the code you have so far? It would make it easier to see what's going on.

+ Reply to Thread

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