May 10, 2013 - There may be times when you want to create a new Excel worksheet based on an existing worksheet. You can easily copy an entire worksheet.
I'm using Excel 2016 on my Mac (v10.11) and currently working on a table for the accounting of my company. It contains two sheets: On the first sheet I list up some costs and give them a projectnr. These costs get copied and pasted on the second sheet. The projectnrs get copied in a protected column, where I need to delete all duplicates. I want to automate this process. If you click on a button on the first page, the rest of the game will be done by itself. For this, I wrote a VBA function like this: Option Explicit Sub Copy ThisWorkbook.Worksheets('FirstTable').Range('R21:R84').Copy ThisWorkbook.Worksheets('SecondTable').Cells(3, 26).PasteSpecial xlPasteValues ThisWorkbook.Worksheets('SecondTable').Activate ThisWorkbook.Worksheets('SecondTable').Range('Z:Z').RemoveDuplicates Columns:=1, Header:=xlYes ThisWorkbook.Worksheets('FirstTable').Activate ActiveWorkbook.Save Call Print End Sub The problem is that the method RemoveDuplicates does not work on mac!
I've tested it on windows and everything works well. Does anyone know what the reason for this could be? If I mark the column on my own and click on remove duplicates in the data tab, it works, but not with this macro.