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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cleaning up data imported into excel 1

Status
Not open for further replies.

Davidprince

Programmer
Jul 1, 2003
52
AU
I am trying to export customer address data from MYOB Accounts Software into Excel and then import it into a filemaker pro Database.
The addresses are coming out of MYOB into excel in a virtually unuseable way.
There are column headings:
1) Contact 2) Company Name 3) Phone 4) Address1

The problem is in Column 4 each line is put in a new row and so different contacts have a variable numbers of rows.
1) Contact 2) Company Name 3) Phone 4) Address1
Perplexed Unknown Pty Ltd 0235689 67 Try Street
JUNO
VERMONT
Perplexed Unknown Pty Ltd 0235689 Unit 1
25 Try Street
SYDNEY
NSW 2000

Any advice gratefully accepted.
David
 
Hi, David.

YOu could try something like this:

Sub FixFormat()
Dim LastRow As Long
Dim x As Long
LastRow = Range("D65536").End(xlUp).Row
For x = LastRow To 2 Step -1
If Range("B" & x).Value = "" Then
Range("D" & x - 1).Value = Range("D" & x - 1).Value & " " & Range("D" & x).Value
Range("D" & x).ClearContents
End If
Next x

End Sub



Anne Troy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top