von Girgei » So, 24.07.2022 13:24
HeritzP hat geschrieben: Sa, 23.07.2022 18:17
Hallo,versuche es mit INDEX(Bereich;VERGLEICH();0).
Hiker hat geschrieben: So, 24.07.2022 08:15
ersetze die rechts daneben liegende Zelle in allen Tabellenblättern durch SVERWEIS(linke Zelle, Importbereich, 2, 0)
Hallo und vielen Dank für die Ratschläge. Aber mit INDEX und SVERWEIS bin ich schlicht und ergreifend überfordert.
Ich glaube ich habe einen für mich einfacheren Weg entdeckt:
Und zwar habe ich ein Makro gemacht, welches mir die erforderlichen Schritte ausführt. Funktioniert gut und blitzschnell, ABER halt immer nur auf
einem Tabellenblatt.
Jetzt wäre es super, wenn mir jemand das Script so ergänzen würde, dass es auf allen Tabellenblätter einer Datei gleichzeitig ausgeführt wird. Ich habe in einem früheren Beitrag hier im Forum gelesen, dass es möglich ist.
Vielen Dank für weitere Unterstützung
Ciao
Girgei
Hier das Script:
Code: Alles auswählen
REM ***** BASIC *****
Sub Main
End Sub
sub Kurs
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$D$9"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$E$1:$F$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Flags"
args3(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args3())
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = "$G$10"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())
rem ----------------------------------------------------------------------
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "ToPoint"
args5(0).Value = "$F$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args5())
rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:FormatCellDialog", "", 0, Array())
rem ----------------------------------------------------------------------
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "ToPoint"
args7(0).Value = "$D$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args7())
rem ----------------------------------------------------------------------
dim args8(17) as new com.sun.star.beans.PropertyValue
args8(0).Name = "SearchItem.StyleFamily"
args8(0).Value = 2
args8(1).Name = "SearchItem.CellType"
args8(1).Value = 0
args8(2).Name = "SearchItem.RowDirection"
args8(2).Value = true
args8(3).Name = "SearchItem.AllTables"
args8(3).Value = false
args8(4).Name = "SearchItem.Backward"
args8(4).Value = false
args8(5).Name = "SearchItem.Pattern"
args8(5).Value = false
args8(6).Name = "SearchItem.Content"
args8(6).Value = false
args8(7).Name = "SearchItem.AsianOptions"
args8(7).Value = false
args8(8).Name = "SearchItem.AlgorithmType"
args8(8).Value = 1
args8(9).Name = "SearchItem.SearchFlags"
args8(9).Value = 65536
args8(10).Name = "SearchItem.SearchString"
args8(10).Value = "aktueller Kurs"
args8(11).Name = "SearchItem.ReplaceString"
args8(11).Value = ""
args8(12).Name = "SearchItem.Locale"
args8(12).Value = 255
args8(13).Name = "SearchItem.ChangedChars"
args8(13).Value = 2
args8(14).Name = "SearchItem.DeletedChars"
args8(14).Value = 2
args8(15).Name = "SearchItem.InsertedChars"
args8(15).Value = 2
args8(16).Name = "SearchItem.TransliterateFlags"
args8(16).Value = 1280
args8(17).Name = "SearchItem.Command"
args8(17).Value = 0
dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args8())
rem ----------------------------------------------------------------------
dim args9(1) as new com.sun.star.beans.PropertyValue
args9(0).Name = "By"
args9(0).Value = 1
args9(1).Name = "Sel"
args9(1).Value = true
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args9())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args11(0) as new com.sun.star.beans.PropertyValue
args11(0).Name = "ToPoint"
args11(0).Value = "$E$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args11())
rem ----------------------------------------------------------------------
dim args12(5) as new com.sun.star.beans.PropertyValue
args12(0).Name = "Flags"
args12(0).Value = "SV"
args12(1).Name = "FormulaCommand"
args12(1).Value = 0
args12(2).Name = "SkipEmptyCells"
args12(2).Value = false
args12(3).Name = "Transpose"
args12(3).Value = false
args12(4).Name = "AsLink"
args12(4).Value = false
args12(5).Name = "MoveMode"
args12(5).Value = 4
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args12())
end sub
[quote=HeritzP post_id=298084 time=1658593039 user_id=64675]
Hallo,versuche es mit INDEX(Bereich;VERGLEICH();0).
[/quote]
[quote=Hiker post_id=298088 time=1658643316 user_id=56977]
[i]ersetze die rechts daneben liegende Zelle in allen Tabellenblättern durch SVERWEIS(linke Zelle, Importbereich, 2, 0)[/i]
[/quote]
Hallo und vielen Dank für die Ratschläge. Aber mit INDEX und SVERWEIS bin ich schlicht und ergreifend überfordert. :shock:
Ich glaube ich habe einen für mich einfacheren Weg entdeckt:
Und zwar habe ich ein Makro gemacht, welches mir die erforderlichen Schritte ausführt. Funktioniert gut und blitzschnell, ABER halt immer nur auf [b]einem[/b] Tabellenblatt.
Jetzt wäre es super, wenn mir jemand das Script so ergänzen würde, dass es auf allen Tabellenblätter einer Datei gleichzeitig ausgeführt wird. Ich habe in einem früheren Beitrag hier im Forum gelesen, dass es möglich ist.
Vielen Dank für weitere Unterstützung
Ciao
Girgei
Hier das Script:
[code]REM ***** BASIC *****
Sub Main
End Sub
sub Kurs
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$D$9"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$E$1:$F$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Flags"
args3(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args3())
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = "$G$10"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())
rem ----------------------------------------------------------------------
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "ToPoint"
args5(0).Value = "$F$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args5())
rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:FormatCellDialog", "", 0, Array())
rem ----------------------------------------------------------------------
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "ToPoint"
args7(0).Value = "$D$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args7())
rem ----------------------------------------------------------------------
dim args8(17) as new com.sun.star.beans.PropertyValue
args8(0).Name = "SearchItem.StyleFamily"
args8(0).Value = 2
args8(1).Name = "SearchItem.CellType"
args8(1).Value = 0
args8(2).Name = "SearchItem.RowDirection"
args8(2).Value = true
args8(3).Name = "SearchItem.AllTables"
args8(3).Value = false
args8(4).Name = "SearchItem.Backward"
args8(4).Value = false
args8(5).Name = "SearchItem.Pattern"
args8(5).Value = false
args8(6).Name = "SearchItem.Content"
args8(6).Value = false
args8(7).Name = "SearchItem.AsianOptions"
args8(7).Value = false
args8(8).Name = "SearchItem.AlgorithmType"
args8(8).Value = 1
args8(9).Name = "SearchItem.SearchFlags"
args8(9).Value = 65536
args8(10).Name = "SearchItem.SearchString"
args8(10).Value = "aktueller Kurs"
args8(11).Name = "SearchItem.ReplaceString"
args8(11).Value = ""
args8(12).Name = "SearchItem.Locale"
args8(12).Value = 255
args8(13).Name = "SearchItem.ChangedChars"
args8(13).Value = 2
args8(14).Name = "SearchItem.DeletedChars"
args8(14).Value = 2
args8(15).Name = "SearchItem.InsertedChars"
args8(15).Value = 2
args8(16).Name = "SearchItem.TransliterateFlags"
args8(16).Value = 1280
args8(17).Name = "SearchItem.Command"
args8(17).Value = 0
dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args8())
rem ----------------------------------------------------------------------
dim args9(1) as new com.sun.star.beans.PropertyValue
args9(0).Name = "By"
args9(0).Value = 1
args9(1).Name = "Sel"
args9(1).Value = true
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args9())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args11(0) as new com.sun.star.beans.PropertyValue
args11(0).Name = "ToPoint"
args11(0).Value = "$E$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args11())
rem ----------------------------------------------------------------------
dim args12(5) as new com.sun.star.beans.PropertyValue
args12(0).Name = "Flags"
args12(0).Value = "SV"
args12(1).Name = "FormulaCommand"
args12(1).Value = 0
args12(2).Name = "SkipEmptyCells"
args12(2).Value = false
args12(3).Name = "Transpose"
args12(3).Value = false
args12(4).Name = "AsLink"
args12(4).Value = false
args12(5).Name = "MoveMode"
args12(5).Value = 4
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args12())
end sub[/code]