Columns Sorting

  • Thread starter Thread starter maily
  • Start date Start date
M

maily

Hi, I do a guest list every week and I start with all the names in on
column and then I cut & copy into other columns so that they all fit o
one page without overflowing into the next page. Is there any way tha
I can just ask it to sort the one column into four columns to si
before the page break
 
Or you can use this. copy the macro into a VB Module (ALT
+ F11, Insert Module)

Sub sortNames()
Dim y As Long, h As Long
Dim rng As Range, dest As Range
nr = Application.CountA(Range("A:A"))
h = nr \ 4

For j = 4 To 2 Step -1
Set rng = Range(Cells(nr, 1), Cells(nr - h + 1, 1))
rng.Cut Destination:=Cells(2, j)
nr = nr - h
Next
End Sub

Close the VB module and return to your list. Choose Tools,
Macros and run the sort names procedure.

Regards
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top