Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Concatenate 12 Adjacent Rows into First Cell in Row

snsd wrote:
I have a workbook with about 150 worksheets in it.
Each worksheet has 12 rows of text ..



Sub zMerge() ' merges A1:A12 into A1
Dim isheet%, irow&, icol%, s1$, s2$
icol = 1
For isheet = 1 To ActiveWorkbook.Sheets.Count
ActiveWorkbook.Sheets(isheet).Select
MsgBox "Now doing sheet " & _
ActiveWorkbook.Sheets(isheet).Name
For irow = 1 To 12
s1 = ActiveWorkbook.Sheets(isheet).Cells(irow, icol)
If irow = 1 Then
s2 = s1
Else
If s1 < "" Then s2 = s2 & " " & s1
End If
ActiveWorkbook.Sheets(isheet).Cells(irow, icol) = ""
Next irow
ActiveWorkbook.Sheets(isheet).Cells(1, 1) = s2
Next isheet
End Sub


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
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
Add cells on two adjacent rows but non-adjacent columns Eve Excel Worksheet Functions 14 October 20th 09 02:32 AM
Compare adjacent fields in adjacent rows Quimera New Users to Excel 6 May 30th 08 11:36 AM
Concatenate multiple rows and columns into 1 cell mj44 Excel Discussion (Misc queries) 21 July 19th 07 09:18 AM
How do I Select Multiple Non Adjacent Rows based on a cell value? avalynch Excel Worksheet Functions 2 October 1st 06 07:45 PM
How to concatenate adjacent cells in a range without using &? Ark Excel Worksheet Functions 4 October 16th 05 06:38 PM


All times are GMT +1. The time now is 12:53 PM.

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"