I have to Trim a cell value thru macro. I have a cell where I am getting a value like "20170411 675432". Here you can see there a space in between 1 and 6. I want to remove that space so that I can get the field value as "20170411675432" Thanks
Asked
Active
Viewed 118 times
0
-
you really want to do this only with macro? there are easier ways to do with formulas – Gowtham Shiva Apr 20 '17 at 15:42
-
Macro only. Anyway if you have any formula, pls post here so that I can get some idea. – Smruti R Mohanty Apr 20 '17 at 15:51
2 Answers
2
Try this:
Function trimacelll(cellalue As Variant)
trimacelll = Replace(CStr(cellalue), " ", "")
End Function

József Kökény
- 336
- 4
- 8
0
Posting this as you have asked for a formula,
=SUBSTITUTE(A1," ","")
A1
should contain the value

Gowtham Shiva
- 3,802
- 2
- 11
- 27
-
@SmrutiRMohanty unfortunately no. Please upvote if you found this useful... – Gowtham Shiva Apr 20 '17 at 16:06