• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Fiyatların toplanması ve iskonto yapması userformda... Yardım...

Katılım
7 Nisan 2007
Mesajlar
112
Excel Vers. ve Dili
xp
A b c ... Diye önceden belirlemiş olduğum fiyatları userformada gösterip bunları toplayıp yanındaki tıklamaları yaptıktan sonra iskonto butonu ile % 5 iskonto yapmak istiyorum örneğim de userformu kaba bir tema ile çizdim yardımcı olabilirmisiniz... Bir türlü bağlayamadım... Yardımcı olursanız sevinirim... şimdiden teşekkür ederim...
 

Ekli dosyalar

Selamlar,

Aşağıdaki kodları denermisiniz.

Kod:
Private Sub CommandButton1_Click()
    Dim X As Byte, BUL As Range
    
    TextBox1 = ""
    
    For X = 1 To 11
        If Controls("CheckBox" & X) = True Then
            Set BUL = Range("A:A").Find(Controls("CheckBox" & X).Caption)
            If Not BUL Is Nothing Then
                TextBox1 = IIf(TextBox1 = "", 0, TextBox1) + BUL.Offset(0, 1)
            End If
        End If
    Next
End Sub
 
Private Sub CommandButton3_Click()
    If TextBox1 <> "" Then TextBox1 = Replace(TextBox1 - (TextBox1 * 0.05), ".", ",")
End Sub
 
selamlar,

aşağıdaki kodları denermisiniz.

Kod:
private sub commandbutton1_click()
    dim x as byte, bul as range
    
    textbox1 = ""
    
    for x = 1 to 11
        ıf controls("checkbox" & x) = true then
            set bul = range("a:a").find(controls("checkbox" & x).caption)
            ıf not bul ıs nothing then
                textbox1 = ııf(textbox1 = "", 0, textbox1) + bul.offset(0, 1)
            end ıf
        end ıf
    next
end sub
 
private sub commandbutton3_click()
    ıf textbox1 <> "" then textbox1 = replace(textbox1 - (textbox1 * 0.05), ".", ",")
end sub

korhan hocam ilginiz için teşekkür ederim...
Yanlız hesapla dediğimde yanındaki labele tl olarak çıkmasını istiyorum m seçeneğinde ise seçeneği seçtiğimizde 110 sabit yanındaki textbox aktif olacak ve içine girdiğim tl yi 110nun üstüne eklemesi lazım... Tekrar bi bakabilirmisin?
 
Selamlar,

Formunuza bir adet CommandButton daha ekleyin. Adı CommandButton4 olsun. Daha sonra aşağıdaki kodları formunuza uygulayın.

Kod:
Private Sub CheckBox11_Click()
    TextBox1.SetFocus
End Sub
 
Private Sub CommandButton1_Click()
    Dim X As Byte, BUL As Range, TOPLAM As Double
    
    TextBox1 = ""
    
    For X = 1 To 11
        If Controls("CheckBox" & X) = True Then
            Set BUL = Range("A:A").Find(Controls("CheckBox" & X).Caption)
            If Not BUL Is Nothing Then
                TOPLAM = TOPLAM + BUL.Offset(0, 1)
            End If
        End If
    Next
    
    Label1.Caption = TOPLAM
End Sub
 
Private Sub CommandButton3_Click()
    If Label1.Caption <> "" Then Label2.Caption = Replace(Label1.Caption - (Label1.Caption * 0.05), ".", ",")
End Sub
 
Private Sub CommandButton4_Click()
    Range("B11") = Range("B11") + TextBox1
End Sub
 
hocam verdiğiniz kodları denedim buton4 de hata veriyor

Range("B11") = Range("B11") + TextBox1

buton 3 te çöze bilirmiyiz buton4 biraz karışık olacak hesapla değimizde

m nin değeri + textbox1 e yazılan miktar m tıklanmadığında textboxa bişi yazılamasın...

birde çıkan sonuçların tl olarak çıkması bi kod yazarmısını teşekkür ederim...
 
bu verdiğniz örnekte b11 110 iken misal 45 ekliyoruz 155 oluyor... benim istediğim 110 sürekli sabit b11 110 kalacal textboxun içine yazılan rakam hesaba dahil olacak textboxa yazılacak değer her hesaplamada değişecek... b11 sabit 110 kalacak...
 
Selamlar,

A-B-C şeklinde giden CheckBoxları seçtiğinizde toplanan değer hangi nesnede gösterilecek?
 
Selamlar,

Peki "m" değeri + TextBox1 toplamı nereye yazılacak?
 
Selamlar,

Aşağıdaki kodları denermisiniz.

Kod:
Private Sub CheckBox11_Click()
    If CheckBox11 = True Then
        TextBox1.Enabled = True
        TextBox1.SetFocus
    Else
        TextBox1 = ""
        TextBox1.Enabled = False
    End If
End Sub
 
Private Sub CommandButton1_Click()
    Dim X As Byte, BUL As Range, TOPLAM As Double
 
    For X = 1 To 10
        If Controls("CheckBox" & X) = True Then
            Set BUL = Range("A:A").Find(Controls("CheckBox" & X).Caption)
            If Not BUL Is Nothing Then
                TOPLAM = TOPLAM + BUL.Offset(0, 1)
            End If
        End If
    Next
 
    If CheckBox11 = True Then
    Set BUL = Range("A:A").Find(CheckBox11.Caption)
    If Not BUL Is Nothing Then
    TOPLAM = TOPLAM + IIf(TextBox1 = "", 0, TextBox1) + BUL.Offset(0, 1)
    End If
    End If
 
    Label1.Caption = Format(TOPLAM, "#,##0.00 TL")
End Sub
 
Private Sub CommandButton3_Click()
    If Label1.Caption <> "" Then Label2.Caption = Format(Replace(Label1.Caption - (Label1.Caption * 0.05), ".", ","), "#,##0.00 TL")
End Sub
 
Private Sub UserForm_Initialize()
    TextBox1.Enabled = False
End Sub
 
selamlar,

aşağıdaki kodları denermisiniz.

Kod:
private sub checkbox11_click()
    ıf checkbox11 = true then
        textbox1.enabled = true
        textbox1.setfocus
    else
        textbox1 = ""
        textbox1.enabled = false
    end ıf
end sub
 
private sub commandbutton1_click()
    dim x as byte, bul as range, toplam as double
    
    for x = 1 to 10
        ıf controls("checkbox" & x) = true then
            set bul = range("a:a").find(controls("checkbox" & x).caption)
            ıf not bul ıs nothing then
                toplam = toplam + bul.offset(0, 1)
            end ıf
        end ıf
    next
    
    ıf checkbox11 = true then
    set bul = range("a:a").find(checkbox11.caption)
    ıf not bul ıs nothing then
    toplam = toplam + ııf(textbox1 = "", 0, textbox1) + bul.offset(0, 1)
    end ıf
    end ıf
    
    label1.caption = format(toplam, "#,##0.00 tl")
end sub
 
private sub commandbutton3_click()
    ıf label1.caption <> "" then label2.caption = format(replace(label1.caption - (label1.caption * 0.05), ".", ","), "#,##0.00 tl")
end sub
 
private sub commandbutton4_click()
    range("b11") = range("b11") + textbox1
end sub
 
private sub userform_ınitialize()
    textbox1.enabled = false
end sub

hocam elinize sağlık harika oldu... Iyi çalışmalar...
 
Selamlar,

CommandButton4 kodunu silmeyi unutmuşum. Onuda silerseniz daha iyi olacaktır. Ben üstteki mesajımı güncelledim.
 
Geri
Üst