Bonjour à tous je suis débutant avec les macros donc j’ai beaucoup de problèmes et de questions.
J’utilise la macro ci dessous pour copier et coller dans une cellule variante. Tout est beau cependant je voudrais coller sans mise en forme puisque les cellules dans lequelles je copie sont de couleurs différents. Donc il faudrait que la cellule copiée soit transparente (sans fond)
Sub copyHere
Const SOURCE_RANGE = "r3"
Dim oCurrentController As Variant, oSheet As Variant
Dim oCellRangeByName As Variant, aRangeAddress As New com.sun.star.table.CellRangeAddress
Dim oCurrentSelection As Variant
Dim oCellByPosition As Variant, aCellAddress As New com.sun.star.table.CellAddress
oCurrentController = ThisComponent.getCurrentController()
oSheet = oCurrentController.getActiveSheet()
oCellRangeByName = oSheet.getCellRangeByName(SOURCE_RANGE)
aRangeAddress = oCellRangeByName.getRangeAddress()
oCurrentSelection = ThisComponent.getCurrentSelection()
If oCurrentSelection.supportsService("com.sun.star.sheet.SheetCellRanges") Then
oCurrentSelection = oCurrentSelection.getByIndex(0)
oCellByPosition = oCurrentSelection.getCellByPosition(0, 0)
aCellAddress = oCellByPosition.getCellAddress()
oSheet.copyRange(aCellAddress, aRangeAddress)
End Sub
Est-ce que quelqu’un peut m’aider?
Merci