ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help on coding please (https://www.excelbanter.com/excel-programming/408063-help-coding-please.html)

Eric

Help on coding please
 
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


Don Guillett

Help on coding please
 
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



Rick Rothstein \(MVP - VB\)[_1521_]

Help on coding please
 
Like Don, I am unsure what you actually want. I think you are saying you
have the text "0.03 (2.6%)" in Temp!A1 and you want to put the "2.6%" part
into Summary!B1. If so, you don't need to use a macro to do that; you can
use this formula in Summary!B1 instead...

=MID(Temp!A1,FIND("(",Temp!A1)+1,LEN(Temp!A1)-FIND("(",Temp!A1)-1)

If the contents of Temp!A1 do not have both an opening and closing
parenthesis, you will get a #VALUE! in Summary!B1.

Rick


"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



Eric

Help on coding please
 
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




Rick Rothstein \(MVP - VB\)[_1522_]

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






All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com