LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
FIRSTROUNDKO via OfficeKB.com
 
Posts: n/a
Default Concatenate Loop

AP,

Thats just awesome

Thanks

Darren


Ardus Petus wrote:
Paste following code in a Module:

'-------------------------------------
Sub concat()
'Cell address of 1st vehicle to be processed
Const strFirstVehicle = "B1"
'assume rank is one column to the left
'and result one column to the right
Dim rng As Range
Dim strResult As String

'Initialize
strRsult = ""
Set rng = Range(strFirstVehicle)

'Loop
Do While rng.Value < ""
strResult = strResult & rng.Value
If rng.Offset(0, -1).Value < "" Then
rng.Offset(0, 1) = strResult
strResult = ""
End If
Set rng = rng.Offset(1, 0)
Loop
End Sub
'----------------------------------------

HTH
--
AP

Ardus,

[quoted text clipped - 12 lines]

Darren


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200603/1


 
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
Loop gone crazy Dave Peterson Excel Discussion (Misc queries) 4 December 16th 05 03:38 PM
Do Loop Noemi Excel Discussion (Misc queries) 0 December 8th 05 10:43 PM
Using Concatenate inside a vlookup bmclean Excel Worksheet Functions 3 July 5th 05 09:29 PM
VB for excel, how do I loop through code steve hobden via OfficeKB.com Excel Discussion (Misc queries) 2 June 9th 05 01:59 PM
Concatenate cells without specifying/writing cell address individually Hari Excel Discussion (Misc queries) 4 January 3rd 05 06:05 PM


All times are GMT +1. The time now is 07:37 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"