[Risolto] Copiare solo numeri o solo testo da macro
Inviato: lunedì 14 maggio 2018, 18:02
Volendo copiare solo il valore delle celle C3:C12, non la formula, come dovrei modificare la macro?
Se invece le celle A3:B12 contenessero testo, e parimenti volessi copiare solo il testo risultante di C3:C12?
Sub Main
Dim CellRangeAddress As New com.sun.star.table.CellRangeAddress
Dim CellAddress As New com.sun.star.table.CellAddress
Doc = ThisComponent
Sheet = Doc.Sheets(0)
CellRangeAddress.Sheet = 0
CellRangeAddress.StartColumn = 2
CellRangeAddress.StartRow = 2
CellRangeAddress.EndColumn = 2
CellRangeAddress.EndRow = 11
CellAddress.Sheet = 0
CellAddress.Column = 3
CellAddress.Row = 2
Sheet.copyRange(CellAddress, CellRangeAddress)
End Sub
Se invece le celle A3:B12 contenessero testo, e parimenti volessi copiare solo il testo risultante di C3:C12?
Sub Main
Dim CellRangeAddress As New com.sun.star.table.CellRangeAddress
Dim CellAddress As New com.sun.star.table.CellAddress
Doc = ThisComponent
Sheet = Doc.Sheets(0)
CellRangeAddress.Sheet = 0
CellRangeAddress.StartColumn = 2
CellRangeAddress.StartRow = 2
CellRangeAddress.EndColumn = 2
CellRangeAddress.EndRow = 11
CellAddress.Sheet = 0
CellAddress.Column = 3
CellAddress.Row = 2
Sheet.copyRange(CellAddress, CellRangeAddress)
End Sub