simple copy column works but ERROR!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Works fine here. You don't have the space in the word "visible" in your
code do you?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top