+ Reply to Thread
Results 1 to 4 of 4

Pasting numbered lines into a cell with autofit

  1. #1
    Registered User
    Join Date
    05-09-2017
    Location
    Ventura Calif
    MS-Off Ver
    MS 2010
    Posts
    2

    Pasting numbered lines into a cell with autofit

    In Excel 2010 I have Autofit the row height for a complete column. This works as expected when I type data into a particular cell. When I get to the edge of the cell it spills over and the height of that cell increases to display the next line. When I take that same data and copy and paste it into another cell it still works correctly with that cell expanding in height. The problem is what I need to do is paste several numbered lines of text into one cell and I am ending up each numbered line being its own Excel row which I don't want.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Pasting numbered lines into a cell with autofit

    .
    .

    This seems to work ok here. Paste this macro into the Sheet level module:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-09-2017
    Location
    Ventura Calif
    MS-Off Ver
    MS 2010
    Posts
    2

    Re: Pasting numbered lines into a cell with autofit

    Hello, thanks for the response here. I have used Excel to a certain extent unfortunately I’m not familiar with any of the coding. Spent the last few hours trying to run your module have not been successful. So if I am opening up a new 2010 Excel workbook do I need to format my column up for AutoFit Row Height? “Do I need to format to “wrap text “? After pressing Alt+F11 what do I do next? Also it seems I have to save as an xltm, is that correct? Thank you

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Pasting numbered lines into a cell with autofit

    Let's say you want this macro to work for Sheet1.

    Right click on the tab down below that says Sheet1.

    Then click on View Code

    Now, on the left hand side, you should see a small window with:

    Sheet1(Sheet1)
    Sheet2(Sheet2)
    Sheet3(Sheet3)
    ThisWorkbook

    Double click on Sheet1(Sheet1). This makes the large window on the right become the Sheet Level Module area where you will paste the code.

    Please Login or Register  to view this content.
    Make certain there is only one line at the top that says OPTION EXPLICIT

    When you save the workbook, save it as Macro Enabled .xlsm

    Now when you type anything into a cell on Sheet 1 it will automatically format itself for word wrap, auto-width/auto-height.

    No need to format anything on the worksheet ... the code is doing that for you.


    You can edit the RowHeight and ColumnWidth by changing the numbers in the macro code: 15.0______8.43

+ 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. [SOLVED] Adding multiple like numbered lines together and spitting the total into a column
    By Clarkit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2014, 01:11 PM
  2. Pasting multiple Lines of text into one cell
    By NonieH in forum Excel General
    Replies: 9
    Last Post: 07-24-2014, 10:38 PM
  3. VB .Autofit works but only up to 4 lines!
    By jblonde002 in forum Excel General
    Replies: 19
    Last Post: 06-17-2014, 07:55 AM
  4. Replies: 10
    Last Post: 10-14-2013, 05:28 AM
  5. Insert lines between rows based on numbered string headers.
    By Xaos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2013, 12:09 PM
  6. Pasting multiple lines of text into one cell
    By hoopz in forum Excel General
    Replies: 4
    Last Post: 07-11-2012, 08:28 PM
  7. [SOLVED] unwanted numbered lines
    By GEGO in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-14-2012, 08:11 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