nachstehender Originalcode, den mir freundlicherweise clag geschrieben hat, überträgt Text als Text, Datum als Datum und Zahlen als Zahlen. Alles chic.
Code: Alles auswählen
sub ChangeCustomerData
myDoc = thisComponent
mySheet = myDoc.sheets(1)
myData = myDoc.sheets(0)
check = mysheet.getCellByPosition(5,6).string
myPid = mysheet.getCellByPosition(4,7).string
if check = "1" then
search = "~"
do until search = myPid
y=y+1
search = myData.getCellByPosition(0,y).string
loop
for i=0 to 8
ReplaceData = mysheet.getCellByPosition(5,8+i).string
if ReplaceData <> "" then
myData.getCellByPosition(1+i,y).string = ReplaceData
end if
next
else
print "Pat.Nr nicht im Bestand"
exit sub
end if
end sub
Code: Alles auswählen
sub ChangeCustomerData
myDoc = thisComponent
mySheet = myDoc.sheets(0)
myData = myDoc.sheets(1)
myPid = mysheet.getCellByPosition(1,1).string
search = "~"
do until search = myPid
y=y+1
search = myData.getCellByPosition(0,y).string
loop
msgbox "Rechnungsnummer" & chr(10)& mypid
for i=0 to 8
ReplaceData = mysheet.getCellByPosition(2,2+i).string
if ReplaceData <> "" then
myData.getCellByPosition(7+i,y).string = ReplaceData
end if
next
end sub
Habt Ihr 'ne Idee?
Gruß Jörg