Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

1 Ağustos 2008 Cuma

Create New vbComponents (Sheet, Chart, DialogSheet)




'UserForm1

'Add Tools on UserForm1: ComboBox1, Label1, TextBox1, ListBox1, CommandButton1, Label2, Label3
Option Explicit
Dim i As Integer
Dim Tip, Eleman, YeniEleman

Private Sub UserForm_Initialize()
On Error Resume Next
Me.Caption = "[PBİD®] CREATE New vbComponents on UserForm..."
With ComboBox1
.AddItem 1: .List(0, 1) = "xlWorksheet"
.AddItem 2: .List(1, 1) = "xlChart"
.AddItem 3: .List(2, 1) = "xlExcel4MacroSheet"
.AddItem 4: .List(3, 1) = "xlExcel4IntlMacroSheet"
.AddItem 5: .List(4, 1) = "xlDialogSheet"
.ColumnCount = 2
.ColumnWidths = "18;54"
.ListWidth = (18 + 54)
End With
Call ListeDüzenle
End Sub
Private Sub ComboBox1_Change()
On Error Resume Next
Label1.Caption = " " & ComboBox1.List(ComboBox1.ListIndex, 1)
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
Tip = ComboBox1.Value
YeniEleman = TextBox1.Value
If Tip <> "" And YeniEleman <> "" Then
Sheets.Add , Sheets(Worksheets.Count), , VBA.Val(Tip)
Call ListeDüzenle
End If
End Sub
Sub ListeDüzenle()
On Error Resume Next
ListBox1.Clear
For Each Eleman In Application.VBE.ActiveVBProject.vbComponents
ListBox1.AddItem Eleman.Name
Next Eleman
End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul