Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to fix the coding? | Excel Worksheet Functions | |||
"=ROW()-1" type of coding doesn't appear in a filter / is there coding that does? | Excel Programming | |||
Implant macro coding into ASP coding | Excel Programming | |||
VBA coding | Excel Programming | |||
Coding | Excel Programming |