Update query to remove spaces and export data

Steviet811

New member
Local time
Today, 00:16
Joined
Sep 1, 2012
Messages
5
Hi

I want to remove random spaces and hard returns from a field replacing them with single spaces. The field is a notes section in memo format and we want to output as a csv files to import into the crm salesforce.com.

Any advice would be gratefully received.

Steviet811
 
The following is code that will remove the carriage return and replace with a space:

Sub RemoveHardReturns()
Selection.find.Execute Replace:=wdReplaceAll
With Selection.find
.Text = "^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.View.ShowAll = Not ActiveWindow.ActivePane.View.ShowAll
End Sub

I found this code on EHow.Com - remove hard returns using VBA

I am not sure on searching for random spaces. How would you define what is just a space and what is a random space?

Thanks,
SBWolfe54
 

Users who are viewing this thread

Back
Top Bottom