- Katılım
- 26 Eylül 2007
- Mesajlar
- 9,421
- Excel Vers. ve Dili
- excel 2010
merhaba
ek dosyada syn leventm'in hazırladığı 3 koşullu ferman görünümlü msgbox ( FermanBox ) mevcut.
veri girişi formatının sınırlandırılmasını (%formatı, tarih formatı, sayı formatı vs gibi) ve hatalı giriş yapılırsa ise 4. 5. 6. mesajları nasıl koyabiliriz.
mevcut kodları biraz kısaltmak lazım, zira koşul sayısı arttıkça çok uzun bir kod oluşacak.
Private Sub Worksheet_Calculate()
If [b17] > 20000 And [b15] <> "" And [b16] <> "" Then
ActiveSheet.Shapes("AutoShape 3").Visible = True
ActiveSheet.Shapes("AutoShape 3").Select
Selection.Characters.Text = Chr(10) & Chr(10) & "bre melun, bu prim ödemekle biter mi!? "
With Selection.Font
.Name = "Blackadder ITC"
.FontStyle = "Normal"
.Size = 20
.ColorIndex = 3
End With
For a = 0 To 245 Step 5
DoEvents
ActiveSheet.Shapes("AutoShape 3").Height = a
Next
[b16] = ""
[b16].Activate
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [b5:b10]) Is Nothing Then GoTo 10
If Not Intersect(Target, [b15:b16]) Is Nothing Then GoTo 20
Exit Sub
10 If [b11] > 1 Then
ActiveSheet.Shapes("AutoShape 3").Visible = True
ActiveSheet.Shapes("AutoShape 3").Select
Selection.Characters.Text = Chr(10) & Chr(10) & "bre melun, % ler toplamı %100 den fazla olamaz! "
With Selection.Font
.Name = "Blackadder ITC"
.FontStyle = "Normal"
.Size = 20
.ColorIndex = 3
End With
For a = 0 To 245 Step 5
DoEvents
ActiveSheet.Shapes("AutoShape 3").Height = a
Next
Target.Activate
Target = ""
End If
Exit Sub
20 If [b15] > [b16] And [b15] <> "" And [b16] <> "" Then
ActiveSheet.Shapes("AutoShape 3").Visible = True
ActiveSheet.Shapes("AutoShape 3").Select
Selection.Characters.Text = Chr(10) & Chr(10) & "bre melun, ölüm tarihi doğum tarihinden küçük! "
With Selection.Font
.Name = "Blackadder ITC"
.FontStyle = "Normal"
.Size = 20
.ColorIndex = 3
End With
For a = 0 To 245 Step 5
DoEvents
ActiveSheet.Shapes("AutoShape 3").Height = a
Next
Target.Activate
Target = ""
End If
End Sub
ek dosyada syn leventm'in hazırladığı 3 koşullu ferman görünümlü msgbox ( FermanBox ) mevcut.
veri girişi formatının sınırlandırılmasını (%formatı, tarih formatı, sayı formatı vs gibi) ve hatalı giriş yapılırsa ise 4. 5. 6. mesajları nasıl koyabiliriz.
mevcut kodları biraz kısaltmak lazım, zira koşul sayısı arttıkça çok uzun bir kod oluşacak.
Private Sub Worksheet_Calculate()
If [b17] > 20000 And [b15] <> "" And [b16] <> "" Then
ActiveSheet.Shapes("AutoShape 3").Visible = True
ActiveSheet.Shapes("AutoShape 3").Select
Selection.Characters.Text = Chr(10) & Chr(10) & "bre melun, bu prim ödemekle biter mi!? "
With Selection.Font
.Name = "Blackadder ITC"
.FontStyle = "Normal"
.Size = 20
.ColorIndex = 3
End With
For a = 0 To 245 Step 5
DoEvents
ActiveSheet.Shapes("AutoShape 3").Height = a
Next
[b16] = ""
[b16].Activate
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [b5:b10]) Is Nothing Then GoTo 10
If Not Intersect(Target, [b15:b16]) Is Nothing Then GoTo 20
Exit Sub
10 If [b11] > 1 Then
ActiveSheet.Shapes("AutoShape 3").Visible = True
ActiveSheet.Shapes("AutoShape 3").Select
Selection.Characters.Text = Chr(10) & Chr(10) & "bre melun, % ler toplamı %100 den fazla olamaz! "
With Selection.Font
.Name = "Blackadder ITC"
.FontStyle = "Normal"
.Size = 20
.ColorIndex = 3
End With
For a = 0 To 245 Step 5
DoEvents
ActiveSheet.Shapes("AutoShape 3").Height = a
Next
Target.Activate
Target = ""
End If
Exit Sub
20 If [b15] > [b16] And [b15] <> "" And [b16] <> "" Then
ActiveSheet.Shapes("AutoShape 3").Visible = True
ActiveSheet.Shapes("AutoShape 3").Select
Selection.Characters.Text = Chr(10) & Chr(10) & "bre melun, ölüm tarihi doğum tarihinden küçük! "
With Selection.Font
.Name = "Blackadder ITC"
.FontStyle = "Normal"
.Size = 20
.ColorIndex = 3
End With
For a = 0 To 245 Step 5
DoEvents
ActiveSheet.Shapes("AutoShape 3").Height = a
Next
Target.Activate
Target = ""
End If
End Sub