açılıştaki kodlar

Katılım
6 Mart 2006
Mesajlar
251
Arkadaşlar merhaba,

UserForm un Initialize kısmında şu şekilde bir kod kullanıyorum.

Private Sub UserForm_Initialize()

g_blnFromCreated = True
g_hwnd = FindWindow(vbNullString, UserForm1.Caption)
If hIcon = 0 Then
hIcon = Me.Image12.Picture.Handle
g_Icon = hIcon
End If
CreateFrmIcon Me, g_hwnd, hIcon

End Sub

Birde aşağıdaki kodlarım var.

son = [a65536].End(3).Row
ListBox1.ColumnCount = 12
ListBox1.RowSource = "Sayfa1!A2:L" & son '"a2:" & "L" & son
son1 = [a65536].End(3).Row
ListBox2.ColumnCount = 11
ListBox2.RowSource = "Sayfa3!A2:k" & son '"a2:" & "k" & son


UserForm un Initialize kısmında bu kodları nasıl birleştirebilirim acaba?

Ben birkaç yol denedim fakat hata veriyor.Bir türlü bulamadım

Şimdiden teşekkürler.
 

isfa5878

Banned
Katılım
15 Kasım 2007
Mesajlar
117
Excel Vers. ve Dili
excel 2003
merhaba
allttaki kod u
form activate ye denedinizmi?
 
Katılım
6 Mart 2006
Mesajlar
251
Activate de bu kodlar var.

Private Sub UserForm_Activate()
Dim wLong As Long
hIcon = Me.Image12.Picture.Handle
g_Icon = hIcon
CreateFrmIcon Me, g_hwnd, hIcon

If Not g_objForm Is Nothing Then Exit Sub
ShowWindow g_hwnd, SW_HIDE
wLong = GetWindowLong(g_hwnd, GWL_EXSTYLE)
wLong = wLong Or WS_EX_CONTROLPARENT Or WS_EX_APPWINDOW
SetWindowLong g_hwnd, GWL_EXSTYLE, wLong
wLong = GetWindowLong(g_hwnd, GWL_STYLE)
wLong = wLong Or WS_MINIMIZEBOX
SetWindowLong g_hwnd, GWL_STYLE, wLong
ShowWindow g_hwnd, SW_NORMAL
Set g_objForm = Me
End Sub
 

isfa5878

Banned
Katılım
15 Kasım 2007
Mesajlar
117
Excel Vers. ve Dili
excel 2003
merhaba.
Private Sub UserForm_Initialize()
..
'öncelikli kod unuz
...
...
...

Application.OnTime Now + TimeValue("00:00:02"), "apart"
End Sub

modüle kod sayfasına aşağıdaki kod......

Sub apart ()
..
..
'sizin öteki kodlarınız
..
..

End Sub
veya kodlarınızı yer değiştirin hangi kodun önceliği vara ınitialize ye onu yazarak bir deneyin bakalım...
 
Son düzenleme:
Üst