Letzte Zelle Suchen
Verfasst: Do, 30.10.2008 16:35
Ich mal wieder.
Ich habe eine Dialog, der verschiedenen Zellen einer Zeile befüllt, angefangen bei B2 und endet bei Q2, wobei manche Zellen sich nach der Eingabe selber Befüllen (über eine Funktion)
.
Wenn jetzt ein Neueintrag erfolgt möchte ich, dass der Dialog automatisch in B3 bis Q3 schreibt, usw.
Dank Komm4 habe ich bisher diesen Code für die Befüllung einzelner Zellen:
Danke
Ibanez

Ich habe eine Dialog, der verschiedenen Zellen einer Zeile befüllt, angefangen bei B2 und endet bei Q2, wobei manche Zellen sich nach der Eingabe selber Befüllen (über eine Funktion)
.
Wenn jetzt ein Neueintrag erfolgt möchte ich, dass der Dialog automatisch in B3 bis Q3 schreibt, usw.
Dank Komm4 habe ich bisher diesen Code für die Befüllung einzelner Zellen:
Code: Alles auswählen
Dim DLG as Object, oTB1 as Object, oTB2 as Object
Dim DLG ,oDoc,oform as Object
Dim Opt_Btn_State as String
Dim Opt_Btn as Object
Sub Eingabe
oDoc = thisComponent
GlobalScope.BasicLibraries.LoadLibrary("Tools")
DLG = LoadDialog("Standard", "Dlg_Eingabe", oDoc.DialogLibraries)
oTB1 = DLG.GetControl("TextField_MA")
oTB2 = DLG.GetControl("TextField_Datum")
oTB3 = DLG.GetControl("TextField_HH")
oTB4 = DLG.GetControl("TextField_MM")
oTB5 = DLG.GetControl("TextField_Termin")
oTB6 = DLG.GetControl("TextField_Ort")
oTB7 = DLG.GetControl("TextField_Nummer")
oTB8 = DLG.GetControl("TextField_Info")
oTB9 = DLG.GetControl("TextField_Auto")
oTB1.Model.Text = oDoc.Sheets(0).GetCellRangeByName("B2").String
oTB2.Model.Text = oDoc.Sheets(0).GetCellRangeByName("C2").String
oTB3.Model.Text = oDoc.Sheets(0).GetCellRangeByName("D2").String
oTB4.Model.Text = oDoc.Sheets(0).GetCellRangeByName("E2").String
oTB5.Model.Text = oDoc.Sheets(0).GetCellRangeByName("F2").String
oTB6.Model.Text = oDoc.Sheets(0).GetCellRangeByName("G2").String
oTB7.Model.Text = oDoc.Sheets(0).GetCellRangeByName("H2").String
oTB8.Model.Text = oDoc.Sheets(0).GetCellRangeByName("M2").String
oTB9.Model.Text = oDoc.Sheets(0).GetCellRangeByName("Q2").String
DLG.execute()
End Sub
sub TB_Change1
oDoc.Sheets(0).GetCellRangeByName("B2").String = oTB1.Model.Text
oDoc.Sheets(0).GetCellRangeByName("C2").String = oTB2.Model.Text
oDoc.Sheets(0).GetCellRangeByName("D2").String = oTB3.Model.Text
oDoc.Sheets(0).GetCellRangeByName("E2").String = oTB4.Model.Text
oDoc.Sheets(0).GetCellRangeByName("F2").String = oTB5.Model.Text
oDoc.Sheets(0).GetCellRangeByName("G2").String = oTB6.Model.Text
oDoc.Sheets(0).GetCellRangeByName("H2").String = oTB7.Model.Text
oDoc.Sheets(0).GetCellRangeByName("M2").String = oTB8.Model.Text
oDoc.Sheets(0).GetCellRangeByName("Q2").String = oTB9.Model.Text
end sub
Ibanez