LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Concatenate text confusion

I have the following code:
Sub CompactWordTables()
Dim C As Range, LastRw As Long, R As Range
With ActiveSheet
.Unprotect
.Columns("M").ClearContents
LastRw = .Range("B65536").End(xlUp).Row
For Each C In .Range("B1", "B" & LastRw)
If Not IsEmpty(C.Offset(0, 1)) Then
For Each R In .Range _
("C" & C.Row, "K" & C.Row)
'may be needed
'R.MergeCells = False
If Not IsEmpty(R) Then
.Range("M" & R.Row).Value = _
C.Value & ", " & R.Value
End If
Next
End If
Next
End With
End Sub

This early code is designed to loop through a range in colB, testing the
adjacent cell in colC. If the colC cell is
not empty, then concatenate the values in that row
(cols C:K) and place the result in colM, where each
element is separated by ", ".

The code is not doing as I intended ...... for starters, it is
missing columns. In my test data, it picks up cols C and
E, but completely skips values in D.

What's my error please?

Regards.


 
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
How to concatenate text into a formula? Wmm Excel Discussion (Misc queries) 5 August 12th 09 09:29 PM
How to concatenate text & date AcctCA755 Excel Discussion (Misc queries) 5 January 19th 09 11:06 PM
How to concatenate cell & text in a text box? Jimbo213 Excel Worksheet Functions 3 March 28th 08 09:00 PM
Sorting pivot tables - text / date confusion malcomio Excel Discussion (Misc queries) 4 January 21st 08 01:52 PM
Using Concatenate function to generate text in Text Box Mary S. Charts and Charting in Excel 1 December 14th 05 08:55 PM


All times are GMT +1. The time now is 03:45 AM.

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

About Us

"It's about Microsoft Excel"