Results 1 to 6 of 6

Combining Columns For Printing

Threaded View

  1. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Combining Columns For Printing

    Maybe:

    Sub Adrian(): Dim wa As Worksheet, ws As Worksheet, r As Long, s As Long, PI As String, i As Long
    Set wa = ActiveSheet:           For Each ws In Worksheets
                            If ws.name = "Summary" Then GoTo SetSummary
                                    Next
                Worksheets.Add(Before:=Worksheets(1)).name = "Summary"
    SetSummary: Set ws = Sheets("Summary"): ws.Columns(1).ColumnWidth = 48: s = 2
                ws.Columns(1).HorizontalAlignment = xlCenter
            For r = 2 To wa.Range("A" & Rows.Count).End(xlUp).row
                For i = 1 To Len(wa.Cells(r, 12))
        If IsNumeric(Mid(wa.Cells(r, 12), i, 1)) Then PI = PI & Mid(wa.Cells(r, 12), i, 1)
                Next i: PI = Left(PI, 3) & "-" & Mid(PI, 4, 3) & "-" & Right(PI, 4)
                    PI = wa.Cells(r, 3) & Chr(10) & _
    wa.Cells(r, 4) & " , " & wa.Cells(r, 5) & " " & wa.Cells(r, 6) & " " & _
                    wa.Cells(r, 7) & Chr(10) & PI
                    ws.Cells(s, 1) = PI: PI = "": s = s + 1
    Next r
    End Sub
    Last edited by xladept; 07-04-2015 at 01:36 PM. Reason: Rewrite of Program

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Combining data in multiple columns(all columns have same length)into one column
    By nzi0001 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 07-24-2014, 11:19 AM
  2. Combining multiple rows from 2 columns into sorted columns depending on 1st columns value
    By Dexamphetamine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2013, 10:00 AM
  3. Replies: 3
    Last Post: 07-16-2012, 03:24 AM
  4. Replies: 2
    Last Post: 01-19-2011, 06:16 PM
  5. Combining Text from 2 Columns into 1 then Deleting the 2 Columns
    By sleepindogg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-30-2006, 02:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1