View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1522_] Rick Rothstein \(MVP - VB\)[_1522_] is offline
external usenet poster
 
Posts: 1
Default Help on coding please

If you can't use the direct formula I posted in my other response, you can
use this macro code to do what you asked...

Sub GetPercentage()
Dim CellText As String
CellText = Worksheets("Temp").Range("A1").Value
Worksheets("Summary").Range("B1").Value = Mid(CellText, InStr(CellText, _
"(") + 1, Len(CellText) - InStr(CellText, "(") - 1)
End Sub

Rick


"Eric" wrote in message
...
I would like to trim the string,
for example
The string is 0.03 (2.6%), in order to retrieve value within blanket
then trim this string and get the value 2.6%, that is what I want.

Get 2.6% from 0.03 (2.6%)

Do you have any suggestions?
Thank you very much for any suggestions
Eric


"Don Guillett" wrote:

Don't really understand what you want but this will copy the cell

sheets("temp").range("a1").copy sheets("summary").range("b1")

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Eric" wrote in message
...
Under Temp worksheet, there is 0.03 (2.6%) in cell A1.
I would like to copy anything inside the blanket (), in this case, I
would
like to copy 2.6% into cell B1 under Summary worksheet.
Does anyone have any suggestions on how to do it in macro coding?
Thanks in advance for any suggestions
Eric