Hi
The below code copy and pastes info from sheet "Csv" and saves it onto a mac desktop as a csv file. The sheet "csv" has a filtered area, if I use the filter to select some rows the code only copy and pastes and saves those rows, but when I 'select all' from the filter box the macro below fails to copy and paste and save all the rows, instead it does whatever the previous filtered result was.
Is there an obvious reason for this, been googling for ages
Thanks
The below code copy and pastes info from sheet "Csv" and saves it onto a mac desktop as a csv file. The sheet "csv" has a filtered area, if I use the filter to select some rows the code only copy and pastes and saves those rows, but when I 'select all' from the filter box the macro below fails to copy and paste and save all the rows, instead it does whatever the previous filtered result was.
Is there an obvious reason for this, been googling for ages
Thanks
Code:
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] ; background-color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffffff]#ffffff[/URL] }p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; background-color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffffff]#ffffff[/URL] ; min-height: 13.0px}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] ; background-color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffffff]#ffffff[/URL] ; min-height: 13.0px}p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=011993]#011993[/URL] ; background-color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffffff]#ffffff[/URL] }span.s1 {color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=011993]#011993[/URL] }span.s2 {color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] }</style>Sub ExportMac()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.CutCopyMode = False
Dim wsCopy As Worksheet, wsPaste As Worksheet
Dim wb As Workbook
Dim sFileName As String, sPath As String, sName As String
sPath = "/Users/User/Desktop/"
sFileName = "ProductFile" & ".csv"
Set wsCopy = ThisWorkbook.ActiveSheet
Set wb = Workbooks.Add
Set wsPaste = wb.Sheets(1)
wsCopy.Cells.Copy
wsPaste.Cells.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
wsPaste.Rows(3).Delete
wsPaste.Rows(2).Delete
wsPaste.Rows(1).Delete
wsPaste.Columns(1).Delete
wb.SaveAs Filename:=sPath & sFileName, FileFormat:=xlCSV
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.ScreenUpdating = True
ActiveSheet.Range("B4").Select
End Sub