Cara Filter Data Dan Mengcopynya Macro Excel 2007

Dear kawan-kawan semuanya…, lama sudah tidak posting di blog ini. kali ini saya akan sharing mengenai pemprograman macro excel. langsung saja, sesuai dengan judul yaitu cara memfilter data kemudia mengcopy hasil filter tersebut ke range lain atau sheet lain..

Berikut codenya:

Sub FilterAndCopy()
Dim z As Long
Sheets("Sheet1").Activate
'untuk unfilter data jika sheet dalam keadaan di filter
If Sheets("Sheet1").FilterMode Then
    Sheets("Sheet1").ShowAllData
End If

'Clear isi sheet 2
Sheets("Sheet2").Cells.Clear

'Filter kolom C dengan criteria "56"
Sheets("Sheet1").Range("C1").AutoFilter Field:=3, Criteria1:="56"

'Copy filtered value ke sheet 2
Sheets("Sheet1").AutoFilter.Range.Copy Sheets("Sheet2").Range("A1")

If Sheets("Sheet1").FilterMode Then
    Sheets("Sheet1").ShowAllData
End If

Sheets("Sheet2").Activate

End Sub

Demikian semoga bermanfaat…

One Response to “Cara Filter Data Dan Mengcopynya Macro Excel 2007”

  1. MRJONS Says:

    thanks alot very helpfull


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: