If I have a Percent in a cell, like in cell A1 '25.1% (note the single quote in front, and in the next column (cell B1) type =Value(A1)*100, everything works as you would expect, cell B1 displays as 25.1 when I try a macro to do the same thing, nothing works. What am I doing wrong??
Code: Select all
for II = 120 to 270
oDoc=ThisComponent
oSheet = oDoc.Sheets.getByName("Calcs")
oCell = oSheet.getCellByposition(3,II) '$D$II+1
Pct = oCell.String
' If II > 123 then goto CPTV4:
' if Left(Pct,1) = "'" then oCell.String = Right(Pct,LEN(Pct)-1)
oCell.String = Value(Pct)*100
' Msgbox "Pct Value= " & oCell.String
next II