0% found this document useful (0 votes)
17 views

Data Notes IM3

Copyright
© Attribution Non-Commercial (BY-NC)
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)
17 views

Data Notes IM3

Copyright
© Attribution Non-Commercial (BY-NC)
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
You are on page 1/ 2

Option Explicit

Private Sub CommandButton1_Click()


Worksheets(ComboBox2.Text).Activate
If ComboBox1.Text = "" And ComboBox2.Text = "" Then
MsgBox "Isi Sheet data yang akan diambil, Tidak Boleh Kosong!", vbOKOnly, "warni
ng!!!"
Else
Dim Tabel As Range, Hasil As Range
Dim i As Long, r As Long, c As Integer
Set Tabel = Sheets(ComboBox1.Text).Cells(3, 1).CurrentRegion
Set Hasil = Sheets(ComboBox2.Text).Cells(4, 1)
For i = 2 To Tabel.Rows.Count
If Tabel(i, 4) <> "" Then
r = r + 1
Hasil(r, 1).Value = Tabel(i, 1).Value
Hasil(r, 2).Value = Tabel(i, 2).Value
Hasil(r, 3).Value = Tabel(i, 3).Value
c = 0
Else
c = c + 1
Hasil(r, 4 + c).Value = Tabel(i, 5).Value
End If
Next i
End If
With Worksheets(ComboBox2.Text)
.Cells(3, 1) = "Nama Agent"
.Cells(3, 2) = "Tanggal Evaluasi"
.Cells(3, 3) = "Score Agent"
End With
HapusDataDuplikat
Unik_data
Data_Boneka
Looking_For_My_Data
Unload AmbilNotes
End Sub
================================================================================
============================
Private Sub UserForm_Activate()
Dim i As Integer
For i = 1 To Worksheets.Count
ComboBox1.AddItem Worksheets(i).Name
ComboBox2.AddItem Worksheets(i).Name
Next
End Sub
================================================================================
============================
Private Sub HapusDataDuplikat()
Dim x As Integer, y As Integer
With Worksheets(ComboBox2.Text)
x = 4
y = x + 1
Do While Cells(x, 1).Value <> ""
Do While Cells(y, 1).Value <> ""
If Cells(x, 1).Value = Cells(y, 1).Value And Cells(x, 2).Value = Cells(y, 2).Val
ue And Cells(x, 3).Value = Cells(y, 3).Value Then
Cells(y, 1).EntireRow.Delete
Else
y = y + 1
End If

Loop
x = x + 1
y = x + 1
Loop
End With
End Sub
================================================================================
============================
Private Sub Unik_data()
With Worksheets(ComboBox2.Text)
Sheets(ComboBox1.Text).Range("D4:D16000").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=.Range("D3"), unique:=True
Range(.Range("D3"), .Range("D3").End(xlDown)).Copy
.Range("E3").PasteSpecial , Transpose:=True
.Range("D3:E3").EntireColumn.Delete
End With
End Sub
================================================================================
============================
Private Sub Data_Boneka()
Worksheets(ComboBox1.Text).Activate
Range("f4").Activate
Do While IsEmpty(ActiveCell.Offset(0, -5)) = False
ActiveCell.FormulaR1C1 = "=rc[-5]&rc[-4]&rc[-3]&rc[-2]"
ActiveCell.Offset(1, 0).Select
Loop
End Sub
================================================================================
============================
Private Sub Looking_For_My_Data()
Worksheets(ComboBox2.Text).Activate
Range("D4").Select
Do While IsEmpty(ActiveCell.Offset(-1, 0)) = False
ActiveCell.FormulaR1C1 = "=index('Notes IM3'!R4C5:R20000C5,match(rc[-3]&rc[-2]&r
c[-1]&R[-1]C,'Notes IM3'!R4C6:R20000C6,0),1)"
ActiveCell.Offset(0, 1).Select
Loop
End Sub

You might also like