K
kima
I would like to make a loop of this on column G. But cant make the loop
Sub ChangeIt(
Dim sTextString As Strin
sTextString = ActiveCell.Valu
Dim sLeftSide As Strin
Dim sRightSide As Strin
'Split text into whole and decimal part
sLeftSide = Left(sTextString, InStr(1, sTextString, ".") - 1
sRightSide = Right(sTextString, Len(sTextString) - 1 - Len(sLeftSide)
'Convert to a double data type
Dim dblConverted As Doubl
'Right side requires a diviso
Dim sDivisor As Strin
sDivisor = "1
Dim i As Intege
For i = 1 To Len(sRightSide
sDivisor = sDivisor & "0
Next
dblConverted = CDbl(sLeftSide) + CDbl(sRightSide) / CDbl(sDivisor
ActiveCell.Value = dblConverte
End Su
Thank You in Advanc
Ki
NEED MORE HELP....this changes decimal point to comma but it removes th
"-" in front of a negative number.
Anyone have another idea to solve this
The case: I have an Excel file, into which I import some numerical dat
on a weekly basis. The imported data uses dots to mark decimals (i.e
24.15 means 24 euros 15 cents), but I want to change this to comma
which is specified in my Windows regional settings to be the decima
symbol.
This can of course be done by selecting the cells and use th
edit-replace funtion, but since I do this every week, I tried to faste
things up by making it a macro instead. The problem now is that Exce
won´t recognise the numbers changed by the macro as real numbers, eve
though they have the comma just like any other value in the sheet
I guess this only applies to European users, but if anybody has
suggestion of how to change the macro so it would work, I would be ver
happy
I use this code for the macro
Range("C34:BF34").Selec
Selection.Replace What:=".", Replacement:=",",
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=Fals
So, the problem is that if I do the exact same operation "by hand"
everything works ok, but if the macro does it, Excel won´t recognise th
changed values as numbers, even though they perfectly correctly contai
commas
Sub ChangeIt(
Dim sTextString As Strin
sTextString = ActiveCell.Valu
Dim sLeftSide As Strin
Dim sRightSide As Strin
'Split text into whole and decimal part
sLeftSide = Left(sTextString, InStr(1, sTextString, ".") - 1
sRightSide = Right(sTextString, Len(sTextString) - 1 - Len(sLeftSide)
'Convert to a double data type
Dim dblConverted As Doubl
'Right side requires a diviso
Dim sDivisor As Strin
sDivisor = "1
Dim i As Intege
For i = 1 To Len(sRightSide
sDivisor = sDivisor & "0
Next
dblConverted = CDbl(sLeftSide) + CDbl(sRightSide) / CDbl(sDivisor
ActiveCell.Value = dblConverte
End Su
Thank You in Advanc
Ki
NEED MORE HELP....this changes decimal point to comma but it removes th
"-" in front of a negative number.
Anyone have another idea to solve this
The case: I have an Excel file, into which I import some numerical dat
on a weekly basis. The imported data uses dots to mark decimals (i.e
24.15 means 24 euros 15 cents), but I want to change this to comma
which is specified in my Windows regional settings to be the decima
symbol.
This can of course be done by selecting the cells and use th
edit-replace funtion, but since I do this every week, I tried to faste
things up by making it a macro instead. The problem now is that Exce
won´t recognise the numbers changed by the macro as real numbers, eve
though they have the comma just like any other value in the sheet
I guess this only applies to European users, but if anybody has
suggestion of how to change the macro so it would work, I would be ver
happy
I use this code for the macro
Range("C34:BF34").Selec
Selection.Replace What:=".", Replacement:=",",
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=Fals
So, the problem is that if I do the exact same operation "by hand"
everything works ok, but if the macro does it, Excel won´t recognise th
changed values as numbers, even though they perfectly correctly contai
commas