güne göre form

Katılım
13 Temmuz 2005
Mesajlar
134
Excel Vers. ve Dili
ofis xp, 2003
arkadaslar auto_open macrosunda ;mesala buğün pazartesi ise 1.form ,salı ise 2.form,şarşamba ise 3.form ile açılmasını nasıl sağlarız.tşk
 
Katılım
29 Eylül 2004
Mesajlar
1,810
Excel Vers. ve Dili
Excel 2002 TR
Kod:
Private Sub Workbook_Open()
bugun = Weekday(Date)
Select Case bugun
Case 1
MsgBox "pzr"
Case 2
MsgBox "pzt"
Case 3
MsgBox "sal"
Case 4
MsgBox "çrş"
Case 5
MsgBox "per"
Case 6
MsgBox "cuma"
Case 7
MsgBox "cts"
End Select
End Sub
mesajbox'lar yerine formlarınızı çağırabilirsiniz.
 

Levent Menteşoğlu

Administrator
Yönetici
Admin
Katılım
13 Ekim 2004
Mesajlar
16,057
Excel Vers. ve Dili
Excel 2010-32 bit-Türkçe
Excel 365 -32 bit-Türkçe
Aşağıdaki kodu deneyin.

[vb:1:28533f72f7]Sub auto_open()
a = Weekday(Date, vbMonday)
If a = 1 Then UserForm1.Show
If a = 2 Then UserForm2.Show
If a = 3 Then UserForm3.Show
End Sub
[/vb:1:28533f72f7]

Not:Ersin beyin kodu daha iyi onu tercih ediniz. Case komutu daha kullanışlı olacaktır.
 
Katılım
13 Temmuz 2005
Mesajlar
134
Excel Vers. ve Dili
ofis xp, 2003
solun teşkürler ...
 
Üst