LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Looping thorough records

Well if you think of a way to do what I am trying to do let me
know.....
Jim Cone wrote:
No it doesn't and I am losing interest.
Regards,
Jim Cone


"Debi H"

wrote in message
ok that worked but it put all of the data from column C-G into one cell in
column B I gues what I am trying to say is it is working good but the
results should be

BRAKE LINE RUBBING, KNOCKING 4 BT93 LY52486 8888
BRAKE LINE RUBBING, KNOCKING 4 BU31 LT91873 2807

column a
BRAKE LINE RUBBING, KNOCKING
column b
4,4
column c
BT93, BU93
column D
LY52486, LT91876
column E
8888,2807

Does that make sense?




"Jim Cone" wrote:

You can just add as many cells as you need to ...
'2 is the column number
& rngCell(lngR, 2).Value

so you would have...
& rngCell(lngR, 2).Value & ", " & rngCell(lngR, 3).Value & ", " & rngCell(lngR, 4).Value 'and so on.

Jim Cone


"Debi H"
wrote in message
one thing I noticed......I have data in column 3-6 for that 2nd row as well
and when it takes the data and merges it from column 2 (B) it deletes the
other date in columns 3-6. I gues I need to merge that data as well??? And
as you will notice the last column may or maynot have data.


BRAKE LINE RUBBING, KNOCKING 4 BT93 LY52486 8888
BRAKE LINE RUBBING, KNOCKING 4 BU31 LT91873 2807
DOOR INNER HANDLE FUNCTION 4 BU33 LW59323 1130
DOOR CUT-OUT WELD ISSUE 4 DU91 LK43454
FOG REARLIGHT FUNCTION 4 DU52 LF68094 1130



"Jim Cone" wrote:

Sub GetRelOpt()
Dim lngR As Long
Dim varToMatch As Variant
Dim rngCell As Excel.Range
Dim rngColumn As Excel.Range

Set rngColumn = Range("A1", Cells(Rows.Count, 1).End(xlUp))
For Each rngCell In rngColumn
If Len(rngCell.Value) Then
varToMatch = rngCell.Value
lngR = 2
Do While rngCell(lngR, 1).Value = varToMatch
rngCell(1, 2).Value = rngCell(1, 2).Value & ", " & rngCell(lngR, 2).Value
rngCell(lngR, 2).EntireRow.Clear
lngR = lngR + 1
Loop
End If
Next
rngColumn.EntireRow.Sort key1:=Range("A1")
End Sub
'------------


"Debi H"
wrote in message
It still did not work and pick up the hood and put the data in the cell in
the B column that related to the hood. Also it put it in 3 different cells
not one




 
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
Delete records when certain records have duplicate column data JVroom New Users to Excel 1 January 26th 09 06:23 PM
draw 999 x 8 random records from file with 8614 records news.wanadoo.nl Excel Programming 1 March 1st 06 03:04 PM
Delete two records together with looping mikeburg[_81_] Excel Programming 2 February 21st 06 05:16 PM
urgent. looping thru all records and applynig formula to get new results shirley Excel Programming 2 April 29th 04 04:32 AM
Looping Through Records. Diana[_5_] Excel Programming 6 December 2nd 03 05:40 PM


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