realdemigod
Board Regular
- Joined
- Aug 19, 2014
- Messages
- 51
- Office Version
- 365
- Platform
- MacOS
Hi,
I wasted a lot of time trying to make a VBA code with Autofilter work in Mac but I understand that Excel Mac does not support Autofilter VBA function. Could you anyone suggest an easier alternative?
I have around 8 lakh rows on Sheet1 and I need to copy rows based on a particular cell value present in column 21 from Sheet1 to Sheet2. So I tried with a code which looks like this.
I'm not able to make this work. Pease help, thanks.
I wasted a lot of time trying to make a VBA code with Autofilter work in Mac but I understand that Excel Mac does not support Autofilter VBA function. Could you anyone suggest an easier alternative?
I have around 8 lakh rows on Sheet1 and I need to copy rows based on a particular cell value present in column 21 from Sheet1 to Sheet2. So I tried with a code which looks like this.
VBA Code:
Sub movedata()
Dim sh As Sheet1
Dim rng As Range
Set rng = sh.Range("A1", sh.Range("A1").End(xlDown)).Select
On Error Resume Next
rng.AutoFilter Field:=21, Criteria1:="UK"
SpecialCells(xlCellTypeVisible).EntireRow.Copy
Sheets(“Sheet2”).Range(“A1”)
.AutoFilter
End With
End Sub
I'm not able to make this work. Pease help, thanks.