
Option Explicit
Sub Da_testo_a_numero()
Dim range1 As Range, range2 As Range
Dim cella As Variant
Dim s As Shape ''nome dello shapes
Set range1 = Range("A7:Z16")
Set range2 = Range("A18:Z28")
Application.EnableEvents = False
DoEvents
Set s = ActiveSheet.Shapes.AddTextEffect(msoTextEffect28, "Attendere Prego", "Impact", _
80#, msoFalse, msoFalse, 100#, 100#)
''' mettiamo le celle a Generale
range1.Select
Selection.NumberFormat = "General"
range2.Select
Selection.NumberFormat = "General"
Range("A1").Activate
''' qui li portiamo tutti a valore
For Each cella In range1
cella.Replace What:=".", Replacement:=","
Cells(cella.Row, cella.Column) = --(cella)
Next
For Each cella In range2
cella.Replace What:=".", Replacement:=","
Cells(cella.Row, cella.Column) = --(cella)
Next
s.Delete
Set s = Nothing
Set range1 = Nothing
Set range2 = Nothing
Application.EnableEvents = True
MsgBox " Elaborazione Terminata "
End Sub
|
Option Explicit
Sub Da_testo_a_numero()
Dim range1_2 As Range
Dim cella As Variant
Dim s As Shape ''nome dello shapes
Set range1_2 = Range("A7:Z16,A18:Z28")
Application.EnableEvents = False
DoEvents
Set s = ActiveSheet.Shapes.AddTextEffect(msoTextEffect28, "Attendere Prego", "Impact", _
80#, msoFalse, msoFalse, 100#, 100#)
''' mettiamo le celle a Generale
range1_2.Select
Selection.NumberFormat = "General"
Range("A1").Activate
''' qui li portiamo tutti a valore
For Each cella In range1_2
cella.Replace What:=".", Replacement:=","
Cells(cella.Row, cella.Column) = --(cella)
Next
s.Delete
Set s = Nothing
Set range1_2 = Nothing
Application.EnableEvents = True
MsgBox " Elaborazione Terminata "
End Sub
|
Set range1_2 = Range("A1:Z1000") |
Range("A7:Z16,A18:Z28")
Range("A7:Z16,A18:Z28,A30:Z40") ecc. ecc.
|
Option Explicit
Sub Da_testo_a_numero()
Dim rangeA1_ZX As Range
Dim cella As Variant, Xcella As Variant
Dim s As Shape ''nome dello shapes
Set rangeA1_ZX = Range("A1:Z" & Cells(Rows.Count, "A").End(xlUp).Row + 2)
Application.EnableEvents = False
DoEvents
Range("A1").Select
Set s = ActiveSheet.Shapes.AddTextEffect(msoTextEffect28, "Attendere Prego", "Impact", _
80#, msoFalse, msoFalse, 100#, 100#)
For Each cella In rangeA1_ZX
Xcella = cella.Value
If Xcella <> "" And IsNumeric(Xcella) Then
With cella
.NumberFormat = "General"
.Replace What:=".", Replacement:=","
End With
Cells(cella.Row, cella.Column) = --(cella)
End If
Next
MsgBox " Elaborazione Terminata "
s.Delete
Set s = Nothing
Set rangeA1_ZX = Nothing
Application.EnableEvents = True
End Sub
|
Option Explicit
Sub Da_testo_a_numero()
Dim rangeA1_ZX As Range
Dim cella As Variant, Xcella As Variant
Dim s As Shape ''nome dello shapes
Set rangeA1_ZX = Range("A1:Z" & Cells(Rows.Count, "A").End(xlUp).Row + 1)
Application.EnableEvents = False
DoEvents
[A1].Select
rangeA1_ZX.FormatConditions.Delete
Set s = ActiveSheet.Shapes.AddTextEffect(msoTextEffect28, "Attendere Prego", "Impact", _
80#, msoFalse, msoFalse, 100#, 100#)
For Each cella In rangeA1_ZX
Xcella = cella.Value
If Xcella <> "" And IsNumeric(Xcella) Then
With cella
.NumberFormat = "General"
.Replace What:=".", Replacement:=","
End With
Cells(cella.Row, cella.Column) = --(cella)
End If
Next
With rangeA1_ZX
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=A1="""""
''.FormatConditions(1).Interior.ColorIndex = 6
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=A1=MIN($A1:$Z1)"
.FormatConditions(2).Interior.ColorIndex = 44
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=A1=MAX($A1:$Z1)"
.FormatConditions(3).Interior.ColorIndex = 33
End With
MsgBox " Elaborazione Terminata "
s.Delete
Set s = Nothing
Set rangeA1_ZX = Nothing
Application.EnableEvents = True
End Sub
|
