Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
gwc gwc is offline
external usenet poster
 
Posts: 62
Default Cells with varying number of lines

A1 contains one line.
B1 contains one line.
C1 contains one to many lines.
D1 contains two lines.
E1 contains one to many lines.
F1 contains one to many lines.

Now do I paste multiple lines into one cell?

How do I make all cells have the same height as the cell with the most lines?

How do I center vertically the contents in the cells that have less than the most lines?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Cells with varying number of lines

hi,

here's one for example

Dim c As Range, txt As String
For Each c In Range("A1:F1")
txt = txt & c.Value & Chr(10)
Next
With Range("A2")
.Value = Left(txt, Len(txt) - 1)
.VerticalAlignment = xlCenter
.WrapText = True
.Rows.AutoFit
End With

isabelle

Le 2014-12-04 08:57, GWC a écrit :
A1 contains one line.
B1 contains one line.
C1 contains one to many lines.
D1 contains two lines.
E1 contains one to many lines.
F1 contains one to many lines.

Now do I paste multiple lines into one cell?

How do I make all cells have the same height as the cell with the most lines?

How do I center vertically the contents in the cells that have less than the most lines?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rows with cells of varying number of lines GWC Excel Programming 5 November 19th 14 02:41 PM
Varying cell ranges in formulas according to number of cells with certain value Dranoeler Excel Worksheet Functions 1 May 20th 13 12:15 PM
Copy Data From Varying Lines to One Sheet Tom Excel Programming 1 March 3rd 10 11:07 PM
Insert a fixed number of lines between a varying range of cells dschindler Excel Programming 3 February 19th 09 09:07 PM
Transpose rows to columns with varying numbers of lines per record SerPetr Excel Programming 1 January 5th 06 03:38 AM


All times are GMT +1. The time now is 08:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"