Qualche suggerimento? io ho provato questo, ma continua a copiarmi le celle vuote
Codice: Seleziona tutto
Sub Copia_celle_non_vuote
dim Doc as object
dim OriShett as object rem foglio origine
dim DesSheet as object rem foglio destinazione
dim Cell as object
dim ConCell as object rem cella di controllo
Doc = ThisComponent
DesSheet = Doc.Sheets.getByName("Destinazione")
OriSheet = Doc.Sheets.getByName("Origine")
Cell = OriSheet.getCellRangeByName("E2")
V = Cell.Value rem massimo celle utilizzate
ii = 1
for i = 1 to V
ConCell = OriSheet.getCellByPosition(0,i)
Con = ConCell.Value
if Con > 0 then
Cell = DesSheet.getCellByPosition(0,ii)
Cell.formula = ("=Origine.A"&(ii+1))
ii = ii + 1
end if
next i
End Sub
