Home > Software engineering >  Vba programming for help
Vba programming for help

Time:10-04


To excel in a cell in the calculation of each digital display to another tripling in the cell, are not required to calculate the results, as long as displayed, as shown above,
A great god please, my email [email protected]

CodePudding user response:

To a simple:
 Function twiceStr (ByVal bStr As String) As String 
"' input 2 * 7 + 6 * 5==& gt; 4 * 14 + 12 * 10
If Len (Trim (bStr))=0 Then the Exit Function
Dim As Long, I w1 As String, w2 As String, w3 As String
For I=1 To Len (bStr)
W2=Mid $(bStr, I, 1)
If InStr (" 0123456789 ", w2) & gt; 0 Then
The w3=w3 & amp; W2
The Else
If the w3 & lt;> "" Then w1=w1 & amp; CStr (Val (w3) * 2)
W1=w1 & amp; W2
The w3=""
End the If
Next
If the w3 & lt;> "" Then w1=w1 & amp; CStr (Val (w3) * 2)
TwiceStr=w1
End the Function


CodePudding user response:

Code upstairs to the ~ is to determine how many characters, and then each character judgment is digital, is multiplied by not retained, and then the whole present in B,
But there is a code directly

CodePudding user response:

Educated, thank you, later had to learn

CodePudding user response:

Great god appeared problems, if this error expanding times is the decimal is

CodePudding user response:

The elder brothers, you did not say a decimal, besides, this little problem should use your head, can't always "to"

The code in the "0123456789" to "0123456789." give it a try
  •  Tags:  
  • VBA
  • Related