Hi again. I have these two scripts. One multiplies a slected cell by a value while the other offers a way to distinguish $ from € when converting currency.
What I want to do is to integrate this code:
Function GetMyFormat(celula As Range) As String
Dim i
i = celula.NumberFormat
If InStr(1, i, "€") <> 0 Then
GetMyFormat = 2
ElseIf InStr(1, i, "$") <> 0 Then
GetMyFormat = 1
End If
End Function
into this one:
Sub Convert()
Dim Cell As Range
For Each Cell In Selection
If IsNumeric(Cell) And Len(Trim(Cell)) > 0 Then Cell = Cell * 1.01
Next Cell
End Sub
Detecting automatically the currency and replacing the original cell (selected one)
Bookmarks