Rabu, 24 Februari 2010

VBA Excel

Option Explicit
Private Sub menu()
Dim obj As CommandBarPopup
Dim objbutton As CommandBarButton
Set obj = Application.CommandBars("Worksheet Menu Bar").Controls("Tools")
On Error Resume Next
Set objbutton = obj.Controls("Report")
If Err.Number <> 0 Then
Set objbutton = obj.Controls.Add(Type:=msoControlButton, before:=4)
End If
On Error GoTo 0
With objbutton
.Caption = "Report"
.OnAction = "Halo"
.FaceId = 248
End With
End Sub
====================================================
Dim obj As Object
Dim baris As Integer
Option Explicit
Private Sub CommandButton1_Click()
baris = baris + 1
Cells(baris, 1).Value = TextBox1.Value
Cells(baris, 2).Value = TextBox2.Value
Cells(baris, 3).Value = ComboBox1.Value

End Sub

Private Sub UserForm_Initialize()

Cells(1, 1).Value = "Nama"
Cells(1, 2).Value = "Alamat"
Cells(1, 3).Value = "Jenis Kelamin"
With ComboBox1
.AddItem "L"
.AddItem "P"
End With

baris = 1
End Sub
=========================================================
Sub Halo()
UserForm1.Show

End Sub

1 komentar:

Unknown mengatakan...

looks great. The parsing of corrupted documents can be also performed by the sql server 2005 database recovery utility, it is the fastest way to open affected files