PC Review


Reply
Thread Tools Rate Thread

ADDRESS MACRO

 
 
JOSEPH WEBER
Guest
Posts: n/a
 
      6th Mar 2008
i have a list of data. all the info is in column a. some info has three
lines some four, some may have more. i need a macro of some sort that would
take all of the data and put it into separate colums. an example is this:

name of company
23 Gates Ave
somewhere, ny 11522
516-xxx-xxxx
accounting

Ruthizer Scott Cpa
30 Gates Ave
somewhere, ny 11552
212-xxx-xxxx


NEEDS TO LOOK LIKE THIS

name of company 23 Gates Ave somewhere, ny 11522 516-xxx-xxxx
Ruthizer Scott Cpa 30 Gates Ave somewhere, ny 11552 212-xxx-xxxx


OBVIOUSLY WITH THE LAST COLUMN IN THERE AS WELL. CITY STATE AND ZIP CAN BE
ALL IN ONE COLUMN. PLEASE HELP



 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      6th Mar 2008
Try this:

Sub spread_um()
n = Cells(Rows.Count, "A").End(xlUp).Row
j = 2
k = 1
For i = 1 To n
Cells(k, j).Value = Cells(i, 1).Value
j = j + 1
If Cells(i, 1).Value = "" Then
j = 2
k = k + 1
End If
Next
End Sub

--
Gary''s Student - gsnu200771


"JOSEPH WEBER" wrote:

> i have a list of data. all the info is in column a. some info has three
> lines some four, some may have more. i need a macro of some sort that would
> take all of the data and put it into separate colums. an example is this:
>
> name of company
> 23 Gates Ave
> somewhere, ny 11522
> 516-xxx-xxxx
> accounting
>
> Ruthizer Scott Cpa
> 30 Gates Ave
> somewhere, ny 11552
> 212-xxx-xxxx
>
>
> NEEDS TO LOOK LIKE THIS
>
> name of company 23 Gates Ave somewhere, ny 11522 516-xxx-xxxx
> Ruthizer Scott Cpa 30 Gates Ave somewhere, ny 11552 212-xxx-xxxx
>
>
> OBVIOUSLY WITH THE LAST COLUMN IN THERE AS WELL. CITY STATE AND ZIP CAN BE
> ALL IN ONE COLUMN. PLEASE HELP
>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      6th Mar 2008
Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim LastRow As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = LastRow To 2 Step -1

If .Cells(i, TEST_COLUMN).Value = "" Then

.Rows(i).Delete
ElseIf .Cells(i - 1, TEST_COLUMN).Value <> "" Then

.Cells(i - 1, TEST_COLUMN).Value = .Cells(i - 1,
TEST_COLUMN).Value _
& " " & .Cells(i, TEST_COLUMN).Value
.Rows(i).Delete
End If
Next i

End With

End Sub


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"JOSEPH WEBER" <JOSEPH (E-Mail Removed)> wrote in message
news:C23060DB-1CEB-42DF-8B6A-(E-Mail Removed)...
>i have a list of data. all the info is in column a. some info has three
> lines some four, some may have more. i need a macro of some sort that
> would
> take all of the data and put it into separate colums. an example is this:
>
> name of company
> 23 Gates Ave
> somewhere, ny 11522
> 516-xxx-xxxx
> accounting
>
> Ruthizer Scott Cpa
> 30 Gates Ave
> somewhere, ny 11552
> 212-xxx-xxxx
>
>
> NEEDS TO LOOK LIKE THIS
>
> name of company 23 Gates Ave somewhere, ny 11522 516-xxx-xxxx
> Ruthizer Scott Cpa 30 Gates Ave somewhere, ny 11552
> 212-xxx-xxxx
>
>
> OBVIOUSLY WITH THE LAST COLUMN IN THERE AS WELL. CITY STATE AND ZIP CAN
> BE
> ALL IN ONE COLUMN. PLEASE HELP
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to convert email address to web address? Victor Delta Microsoft Excel Misc 4 13th Oct 2010 11:13 PM
Macro to print to IP address Larry S Microsoft Excel Programming 3 3rd Sep 2008 03:51 PM
macro for address vince cash Microsoft Excel Discussion 1 13th Oct 2006 07:02 PM
Change IP address with macro broogle Microsoft Excel Programming 0 8th Jul 2005 01:51 AM
Address Retrieval Macro Rob F Microsoft Outlook VBA Programming 3 7th Jan 2004 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:14 AM.