+ Reply to Thread
Results 1 to 4 of 4

Format from column to single cell

Hybrid View

cjewell Format from column to single... 02-17-2014, 08:54 AM
Olly Re: Format from column to... 02-17-2014, 09:46 AM
cjewell Re: Format from column to... 02-17-2014, 10:45 PM
Olly Re: Format from column to... 02-18-2014, 04:09 AM
  1. #1
    Registered User
    Join Date
    07-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Format from column to single cell

    I am a macro beginner and I have a column of numbers that I need to reformat. I created a macro to copy/paste special/transpose to get the data into separate columns. I then used & to get them into one cell. I can only have five sets of # in each cell. The macro works but it replaces the previous set of accounts. Is this the best way to reformat these numbers? If so, how do I correct the macro so that it doesnt replace the data i already reformatted?

    I have attached a sample spreadsheet. Hope it worked!

    Thanks so much!
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Format from column to single cell

    Not sure I am quite clear on the requirement - are you trying to move all the numbers from Column A to Column K, but concatenated into groups of 5?

    If so, try:
    Sub foo()
    Dim i As Integer, lRow As Long
    Application.ScreenUpdating = False
    lRow = 1
    Do Until Range("A1") = ""
        For i = 1 To 5
            Range("K" & lRow).Value = Trim(Range("K" & lRow).Value & " " & Range("A" & i).Value)
        Next i
        Range("A1:A5").Delete Shift:=xlUp
        lRow = lRow + 1
    Loop
    Application.ScreenUpdating = True
    End Sub
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Format from column to single cell

    Yes, I need to reformat these numbers into a single cell and each cell can only have 5 sets of #'s. I tried the above and it didnt work? Not sure if I'm doing something wrong?

    Thank you

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Format from column to single cell

    Expand on "didn't work"... What exactly happened? Worked perfectly for me, on the source data you posted.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple Date format in single column
    By Mukesh Sajjan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-31-2014, 08:17 AM
  2. Replies: 1
    Last Post: 01-13-2014, 04:21 AM
  3. Convert single column to table format
    By busybeas in forum Excel General
    Replies: 5
    Last Post: 03-21-2012, 02:38 PM
  4. Replies: 1
    Last Post: 06-27-2005, 06:05 AM
  5. [SOLVED] Format a single column into a row
    By shepbinker in forum Excel General
    Replies: 5
    Last Post: 02-05-2005, 03:07 AM

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