I would greatly appreciate some assistance in figuring out how to remove the spaces between words. I will only need to target whatever is in cell "A1" for example if I have "Next Ex" in the cell I want the macro to change it to "NextEx". I will run this on multiple sheets that's why a formula would not be my best option.
3 Answers
Consider:
Sub NoSpace()
Dim sh As Worksheet
For Each sh In Sheets
sh.Range("A1").Replace what:=" ", replacement:=""
Next sh
End Sub
VBA:
Dim cellText As String
cellText = [Get Cell Text From Worksheet]
cellText = Replace(cellText," ", "")
Formula:
=SUBSTITUTE(A1," ","")
SUBSTITUTE()
orREPLACE()
in a loop.A1
and display it with all the spaces removed in some other cell (such asA2
orQ42
) on every sheet, that doesn’t require a loop and can easily be done with a formula. The better you describe your requirements, the better we can answer you.