VBA/Excel/Access/Word/String Functions/Right — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 19:33, 26 мая 2010
Move the sign from the right-hand side thus changing a text string into a value.
<source lang="vb">
Sub MoveMinus()
On Error Resume Next Dim cel As Range Dim myVar As Range Set myVar = Selection For Each cel In myVar If Right((Trim(cel)), 1) = "-" Then cel.Value = cel.Value * 1 End If Next
End Sub
</source>
Right() Returns a substring from the right side of a string.
<source lang="vb">
Sub strDemo6()
Debug.Print Right("Test", 2)
End Sub
</source>