ďťż

Mefisto...diabeł czy anioł?

co muszę zmienić w kodzie aby zapisywał mi dane w kolumnie B, gdy zmienię w linni Cells(ostatnia + 1, 1) = StrConv(TextBox1.Text, vbProperCase) 1 na 2 to zapisuje w drugiej kolumnie ale za to nie zapisuje wyników w wierszu poniżej tylko kasuje poprzedni zapis i wpisuje w tym samym wierszu
Option Explicit

Private Sub CommandButton1_Click()
Dim ostatnia As Long
If Len(TextBox1.Text) = 0 Then MsgBox "Wpisz indeks", , "Popraw": Exit Sub
If Len(TextBox2.Text) = 0 Then MsgBox "Wpisz nazwę", , "Popraw": Exit Sub
If Len(TextBox3.Text) = 0 Then MsgBox "Wpisz jednostkę miary", , "POPRAW": Exit Sub
If Len(TextBox6.Text) = 0 Then MsgBox "Wpisz wagę", , "Popraw": Exit Sub
If WorksheetFunction.CountIf(Columns(1), TextBox1.Text) > 0 Then MsgBox "Taki INDEKS już istnieje!": Exit Sub

ostatnia = Columns(1).Find(What:="*", After:=Cells(1, 1), _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Cells(ostatnia + 1, 1) = StrConv(TextBox1.Text, vbProperCase)
Cells(ostatnia + 1, 3) = StrConv(TextBox2.Text, vbProperCase)
Cells(ostatnia + 1, 4) = StrConv(TextBox3.Text, vbProperCase)
Cells(ostatnia + 1, 4) = StrConv(TextBox4.Text, vbProperCase)
Cells(ostatnia + 1, 5) = StrConv(TextBox5.Text, vbProperCase)
Cells(ostatnia + 1, 10) = StrConv(TextBox6.Text, vbProperCase)
Cells(ostatnia + 1, 6).NumberFormat = "@"
Cells(ostatnia + 1, 6) = TextBox6.Text
TextBox1 = "": TextBox2 = "": TextBox3 = "": TextBox4 = "": TextBox5 = "": TextBox6 = ""
End Sub

[ Dodano: 2007-06-28, 12:41 ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • katkaras.opx.pl