Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I transform this:
myVar = " 7.200" 'spaces are there to myNewVar = "7200" Thanks Tom |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try myVar=replace(myvar," ","") or try myvar=application.worksheetfunctions.trim(myvar) -- Regards Frank Kabel Frankfurt, Germany TOM wrote: How can I transform this: myVar = " 7.200" 'spaces are there to myNewVar = "7200" Thanks Tom |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Alternatively, you can use also Cdbl
myvar1 = CDbl(myvar -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just to add to the excellent suggestion.
myVar = " 7.200" ? cdbl(myVar) 7.2 is a good thought, but unless it was a typo, it doesn't quite match the requested results. myNewVar = "7200" perhaps ? cdbl(myvar)*1000 7200 with myNewVar dimensioned as String -- Regards, Tom Ogilvy "Pierre " wrote in message ... Alternatively, you can use also Cdbl myvar1 = CDbl(myvar) --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
Doesn't that depend on the decimal separator ? Nick "Tom Ogilvy" wrote in message ... Just to add to the excellent suggestion. myVar = " 7.200" ? cdbl(myVar) 7.2 is a good thought, but unless it was a typo, it doesn't quite match the requested results. myNewVar = "7200" perhaps ? cdbl(myvar)*1000 7200 with myNewVar dimensioned as String -- Regards, Tom Ogilvy "Pierre " wrote in message ... Alternatively, you can use also Cdbl myvar1 = CDbl(myvar) --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
in VBA always the dot is used as separator (regardless of your regional settings) -- Regards Frank Kabel Frankfurt, Germany NickHK wrote: Tom, Doesn't that depend on the decimal separator ? Nick "Tom Ogilvy" wrote in message ... Just to add to the excellent suggestion. myVar = " 7.200" ? cdbl(myVar) 7.2 is a good thought, but unless it was a typo, it doesn't quite match the requested results. myNewVar = "7200" perhaps ? cdbl(myvar)*1000 7200 with myNewVar dimensioned as String -- Regards, Tom Ogilvy "Pierre " wrote in message ... Alternatively, you can use also Cdbl myvar1 = CDbl(myvar) --- Message posted from http://www.ExcelForum.com/ |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
He showed a period. Since he didn't state he wanted a turnkey internation
solution, then I guess not. -- Regards, Tom Ogilvy "NickHK" wrote in message ... Tom, Doesn't that depend on the decimal separator ? Nick "Tom Ogilvy" wrote in message ... Just to add to the excellent suggestion. myVar = " 7.200" ? cdbl(myVar) 7.2 is a good thought, but unless it was a typo, it doesn't quite match the requested results. myNewVar = "7200" perhaps ? cdbl(myvar)*1000 7200 with myNewVar dimensioned as String -- Regards, Tom Ogilvy "Pierre " wrote in message ... Alternatively, you can use also Cdbl myvar1 = CDbl(myvar) --- Message posted from http://www.ExcelForum.com/ |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
myVar = Application.substitute(application.Substitute(myVa r,".","")," ","")
-- Regards, Tom Ogilvy "TOM" wrote in message ... How can I transform this: myVar = " 7.200" 'spaces are there to myNewVar = "7200" Thanks Tom |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or to assign to myNewVar
myNewVar = Application.substitute(application.Substitute(myVa r,".","")," ","") or myNewVar = Trim(application.Substitute(myVar,".","")) myVar = " 7.200" myNewVar = Trim(application.Substitute(myVar,".","")) ? myNewVar 7200 -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... myVar = Application.substitute(application.Substitute(myVa r,".","")," ","") -- Regards, Tom Ogilvy "TOM" wrote in message ... How can I transform this: myVar = " 7.200" 'spaces are there to myNewVar = "7200" Thanks Tom |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
HI you can try the following formula Iam sure it will work
you can substitute the RowColumn info for a variable it will work the same, keep in mind those parenthesis are very tricky PAY STRICT attention to them =(TRUNC(C12)&(RIGHT((TRIM(C12)),(LEN(TRIM(C12))- FIND(".", (TRIM(C12))))))) -----Original Message----- How can I transform this: myVar = " 7.200" 'spaces are there to myNewVar = "7200" Thanks Tom . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
transform formula | Excel Worksheet Functions | |||
How I transform a row into a column? | Excel Discussion (Misc queries) | |||
How I transform a row into a column? | Excel Discussion (Misc queries) | |||
Table Transform | Excel Discussion (Misc queries) | |||
Transform columns with VBA | Excel Programming |