è un po lunghetta...funziona su Excel ma non nei form di VB6 perchè non specificato bene la cella del foglio excel

Sub Macrovalerio()
'

'

' Trasforma il contenuto di una cella da formula a valore

Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub


Sub Valerio()


Dim a(5), b(8), p(8), f(8)
' Rows("1:20").Select
' Selection.Delete Shift:=xlUp
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Range("A17").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Rows("1:16").Select
Selection.Delete Shift:=xlUp
Columns("A").Select
Columns("A").EntireColumn.AutoFit
Range("A1").Select
a(1) = Cells(2, 2).Value
a(2) = Cells(3, 2).Value
a(3) = Cells(4, 2).Value
a(4) = Cells(2, 4).Value
a(5) = Cells(3, 4).Value
b(1) = "eccellente"
b(2) = "buono"
b(3) = "accettabile"
b(4) = "insufficiente"
b(5) = "debole"
b(6) = "scarso"
b(7) = "tremendo"
b(8) = "disastroso"
p(1) = 1500
p(2) = 1000
p(3) = 500
p(4) = 250
p(5) = 125
p(6) = 0
p(7) = -62.5
p(8) = -125
f(1) = 1.2
f(2) = 1.1
f(3) = 1
f(4) = 0.9
f(5) = 0.8
f(6) = 0.7
f(7) = 0.6
f(8) = 0.5
k = 0
For i = 1 To 5
For j = 1 To 8
If a(i) = b(j) Then k = k + p(j)
Next
Next
For j = 1 To 8
If Cells(1, 2).Value = b(j) Then k = k * f(j)
Next
Cells(8, 1).Value = "Punteggio"
Cells(8, 2).Value = k
Cells(9, 1).Value = "Forma"
For j = 1 To 8
Cells(8 + j, 2) = b(j)
Cells(8 + j, 3) = k * f(j)
Next
Range("C9:C16").Select
Selection.Style = "Comma"
Selection.NumberFormat = "_-* #,##0.0_-;-* #,##0.0_-;_-* ""-""??_-;_-@_-"
Selection.NumberFormat = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-"
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
Range("B9:C16").Select
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1").Select
End Sub