Hi,
I get the error "Method 'Paste' of object '_Worksheet' failed" when I run the following macro.
Sub SaveVisible()
'
' SaveVisible Macro
' Macro recorded 2/8/2005 by amer
'
'
Cells.Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Workbooks.Add
Cells.Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\amer\My Documents\abcd.txt", _
FileFormat:=xlText, CreateBackup:=False
End Sub
The purpose of the macro is to create a new excel file with the copied data from another file. I don not want to copy hidden rows and columns thus i copy only the visible data.
Could anyone please correct the macro or give a any other method of doing this kind of copy.
Thanks
Amer
I get the error "Method 'Paste' of object '_Worksheet' failed" when I run the following macro.
Sub SaveVisible()
'
' SaveVisible Macro
' Macro recorded 2/8/2005 by amer
'
'
Cells.Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Workbooks.Add
Cells.Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\amer\My Documents\abcd.txt", _
FileFormat:=xlText, CreateBackup:=False
End Sub
The purpose of the macro is to create a new excel file with the copied data from another file. I don not want to copy hidden rows and columns thus i copy only the visible data.
Could anyone please correct the macro or give a any other method of doing this kind of copy.
Thanks
Amer