iki kodu tek butonda birleştirme

Katılım
22 Ocak 2007
Mesajlar
321
Excel Vers. ve Dili
offıce 2003
Değerli hocalarım ve arkadaşlarım sorumu biraz daha açmak istedim.aşağıdaki kodları tek butona atamak istiyorum;
Private Sub CommandButton4_Click()
Sheets("ÜRÜNLER").Select
If TextBox1 = "" Then MsgBox "LÜTFEN ÜRÜN KODU GİRİNİZ !", vbExclamation, "DİKKAT !": TextBox1.SetFocus: Exit Sub
Set Bul = Cells.Find(What:=TextBox1.Value, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
If Not Bul Is Nothing Then
UserForm3.TextBox3.Value = Cells(Bul.Row, 2)
Else
MsgBox "ARADIĞINIZ KAYIT BULUNAMAMIŞTIR !..LÜFTEN YENİ STOK GİRİŞİ YAPINIZ", vbExclamation, "DİKKAT !"
End If
End Sub
.......
Private Sub CommandButton5_Click()
Sheets(ComboBox1.Value).Select
If TextBox1 = "" Then MsgBox "LÜTFEN ÜRÜN KODU GİRİNİZ !", vbExclamation, "DİKKAT !": TextBox1.SetFocus: Exit Sub
Set Bul = Cells.Find(What:=TextBox1.Value, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
TextBoxSatir.Value = Bul.Row
If Not Bul Is Nothing Then
UserForm3.TextBox2.Value = Cells(Bul.Row, 2)
Else
MsgBox "ARADIĞINIZ KAYIT BU ŞEHİRE BULUNAMAMIŞTIR. !..LÜFTEN GİRİŞ YAPINIZ", vbExclamation, "DİKKAT !"
End If
End Sub
 
Katılım
22 Ocak 2007
Mesajlar
321
Excel Vers. ve Dili
offıce 2003
değerli arkadaşlarım cevap gelmediğine göre zannediyorum bu iki kod tek butonda birleşmiyor.başka bir yol mu denemem gerekecek?
 
Üst