+ Reply to Thread
Results 1 to 3 of 3

simple copy column works but ERROR!

  1. #1
    Jack
    Guest

    simple copy column works but ERROR!

    I use the following to 1) delete content in sheet 1 a:b
    2) copy 2 columns (a:b) that are filtered - sheet2

    Sub Macro1()
    Sheets("Sheet1").Columns("A:B").ClearContents
    Sheets("Sheet3").Activate
    ActiveSheet.UsedRange.SpecialCells(xlCellTypeVisible).Copy _
    Destination:=Sheet1.Range("A1")

    End Sub

    I need this to paste in sheet1 - a1. It works but I get an error 1044.
    Is my syntex correct? Am I able to ignore error?


  2. #2
    Registered User
    Join Date
    11-13-2004
    Posts
    49
    Works fine here. You don't have the space in the word "visible" in your code do you?

  3. #3
    Gord Dibben
    Guest

    Re: simple copy column works but ERROR!

    Jack

    Sheet1 may not be "Sheet1"

    Try this amended version.

    Sub Macro1()
    Sheets("Sheet1").Columns("A:B").ClearContents
    Sheets("Sheet3").Activate
    ActiveSheet.UsedRange.SpecialCells(xlCellTypeVisible).Copy _
    Destination:=Sheets("Sheet1").Range("A1")
    End Sub


    Gord Dibben Excel MVP

    On Tue, 29 Nov 2005 18:22:01 -0800, "Jack" <[email protected]>
    wrote:

    >I use the following to 1) delete content in sheet 1 a:b
    >2) copy 2 columns (a:b) that are filtered - sheet2
    >
    >Sub Macro1()
    >Sheets("Sheet1").Columns("A:B").ClearContents
    >Sheets("Sheet3").Activate
    >ActiveSheet.UsedRange.SpecialCells(xlCellTypeVisible).Copy _
    >Destination:=Sheet1.Range("A1")
    >
    >End Sub
    >
    >I need this to paste in sheet1 - a1. It works but I get an error 1044.
    >Is my syntex correct? Am I able to ignore error?



+ 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