Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing all spaces from a string... 1

Status
Not open for further replies.

ftpdoo

Programmer
Aug 9, 2001
202
GB
Hi,

I've got a string which contains a binary number

ie: " 0 0 1 0"

But I want to remove the spaces to simply leave "0010"


Please help,
Jonathan
 
Try this...

Sub MyMacro()
With ActiveSheet.Cells
.Replace What:=" ", Replacement:=""
End With
End Sub


This will remove the leading zero's - but for a binary, that's obviously not a problem...!!

Cheers.
wadjssd
 
use the vb function
string = replace(string," ","")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top