0% found this document useful (0 votes)
20 views1 page

Excel & VBA UserForm Data Filter Tutorial

This tutorial demonstrates how to filter data from one range and copy it to another range in Excel using VBA. It shows filtering data on a sheet using criteria, then copying the filtered data to another range if rows are found, or displaying a message if no rows are found.

Uploaded by

raihanbahansubu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Excel & VBA UserForm Data Filter Tutorial

This tutorial demonstrates how to filter data from one range and copy it to another range in Excel using VBA. It shows filtering data on a sheet using criteria, then copying the filtered data to another range if rows are found, or displaying a message if no rows are found.

Uploaded by

raihanbahansubu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

--------------------------------------------

COSING FORM STOK - EXCEL & VBA TUTORIAL


--------------------------------------------
Option Explicit

Private Sub UserForm_Initialize()


[Link] = RGB(38, 41, 47)
On Error GoTo Salah
Dim iRow As Long
Dim DCARIDATA As Object
Set DCARIDATA = Sheet3
[Link]("A5").[Link] Action:=xlFilterCopy,
CriteriaRange:= _
[Link]("J5:J6"), CopyToRange:=[Link]("L5:S5"), Unique:=False
iRow = [Link]("L" & [Link]).End(xlUp).Row
If [Link]([Link]("L6:L999999")) = 0 Then
[Link] = ""
Call MsgBox("Data tidak ditemukan", vbInformation, "Cari Data")
Else
[Link] = "PRODUK!L6:S" & iRow
End If
Exit Sub
Salah:
Call MsgBox("Maaf Data tidak ditemukan", vbInformation, "Cari Data")

End Sub

You might also like