Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Large Concatenate

Hi all. I have a database style worksheet that has in column A a persons
name. In columns B through AZ are items that person is authorized to work
on (pulldown list). This data will be uploaded to an ERP sytem, and need to
be in the format:
Joe|Item1|Item2|Item3|Item9|...
I can use a simple concatenate, but it will be huge. Is there a way to
programatically do this without actually using concatenate? It is also very
possible that columns could be blank. As above, Joe has data in the 1st 3
columns, then skips a few, then again in 9. Ideally, before Upload I'd like
to look at each row, and move all data to the left to eliminate blanks
columns. Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Large Concatenate


iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
iLastCol = Cells(i,Columns.Count).End(xlToLeft).Column
For j = 2 to iLastCol
If cells(i,j).Value < "" Then
cells(I,1).Value = cells(i,1).Value & "|" & cells(i,j).Value
cells(i,j).Value =""
End If
Next j
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steph" wrote in message
...
Hi all. I have a database style worksheet that has in column A a persons
name. In columns B through AZ are items that person is authorized to work
on (pulldown list). This data will be uploaded to an ERP sytem, and need

to
be in the format:
Joe|Item1|Item2|Item3|Item9|...
I can use a simple concatenate, but it will be huge. Is there a way to
programatically do this without actually using concatenate? It is also

very
possible that columns could be blank. As above, Joe has data in the 1st 3
columns, then skips a few, then again in 9. Ideally, before Upload I'd

like
to look at each row, and move all data to the left to eliminate blanks
columns. Thanks.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Large Concatenate

Thanks Bob. Can I ask one more small favor? Turns out I need one more
column "concatenated". Is your code easy to modify to concatenate ColA,
ColB and then the 50 or so columns? Thank you!!!!

"Bob Phillips" wrote in message
...

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
iLastCol = Cells(i,Columns.Count).End(xlToLeft).Column
For j = 2 to iLastCol
If cells(i,j).Value < "" Then
cells(I,1).Value = cells(i,1).Value & "|" &
cells(i,j).Value
cells(i,j).Value =""
End If
Next j
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steph" wrote in message
...
Hi all. I have a database style worksheet that has in column A a persons
name. In columns B through AZ are items that person is authorized to
work
on (pulldown list). This data will be uploaded to an ERP sytem, and need

to
be in the format:
Joe|Item1|Item2|Item3|Item9|...
I can use a simple concatenate, but it will be huge. Is there a way to
programatically do this without actually using concatenate? It is also

very
possible that columns could be blank. As above, Joe has data in the 1st
3
columns, then skips a few, then again in 9. Ideally, before Upload I'd

like
to look at each row, and move all data to the left to eliminate blanks
columns. Thanks.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Large Concatenate

Steph,

It should already concatenate however many columns there are

Bob


"Steph" wrote in message
...
Thanks Bob. Can I ask one more small favor? Turns out I need one more
column "concatenated". Is your code easy to modify to concatenate ColA,
ColB and then the 50 or so columns? Thank you!!!!

"Bob Phillips" wrote in message
...

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
iLastCol = Cells(i,Columns.Count).End(xlToLeft).Column
For j = 2 to iLastCol
If cells(i,j).Value < "" Then
cells(I,1).Value = cells(i,1).Value & "|" &
cells(i,j).Value
cells(i,j).Value =""
End If
Next j
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steph" wrote in message
...
Hi all. I have a database style worksheet that has in column A a

persons
name. In columns B through AZ are items that person is authorized to
work
on (pulldown list). This data will be uploaded to an ERP sytem, and

need
to
be in the format:
Joe|Item1|Item2|Item3|Item9|...
I can use a simple concatenate, but it will be huge. Is there a way to
programatically do this without actually using concatenate? It is also

very
possible that columns could be blank. As above, Joe has data in the

1st
3
columns, then skips a few, then again in 9. Ideally, before Upload I'd

like
to look at each row, and move all data to the left to eliminate blanks
columns. Thanks.








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Large Concatenate

Understood. Thanks Bob!

"Bob Phillips" wrote in message
...
Steph,

It should already concatenate however many columns there are

Bob


"Steph" wrote in message
...
Thanks Bob. Can I ask one more small favor? Turns out I need one more
column "concatenated". Is your code easy to modify to concatenate ColA,
ColB and then the 50 or so columns? Thank you!!!!

"Bob Phillips" wrote in message
...

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
iLastCol = Cells(i,Columns.Count).End(xlToLeft).Column
For j = 2 to iLastCol
If cells(i,j).Value < "" Then
cells(I,1).Value = cells(i,1).Value & "|" &
cells(i,j).Value
cells(i,j).Value =""
End If
Next j
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steph" wrote in message
...
Hi all. I have a database style worksheet that has in column A a

persons
name. In columns B through AZ are items that person is authorized to
work
on (pulldown list). This data will be uploaded to an ERP sytem, and

need
to
be in the format:
Joe|Item1|Item2|Item3|Item9|...
I can use a simple concatenate, but it will be huge. Is there a way
to
programatically do this without actually using concatenate? It is
also
very
possible that columns could be blank. As above, Joe has data in the

1st
3
columns, then skips a few, then again in 9. Ideally, before Upload
I'd
like
to look at each row, and move all data to the left to eliminate blanks
columns. Thanks.










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
Large list of numbers to concatenate MaggieB. Excel Worksheet Functions 3 June 3rd 10 11:57 PM
Concatenate large numbers of cells Seldonian Crisis[_2_] Excel Discussion (Misc queries) 4 November 27th 07 04:44 PM
Concatenate Jordan Excel Worksheet Functions 3 February 23rd 06 11:59 PM
Concatenate tbobo Excel Discussion (Misc queries) 4 February 15th 06 04:04 AM
I know how to concatenate ,can one de-concatenate to split date? QUICK BOOKS PROBLEM- New Users to Excel 1 July 26th 05 05:07 PM


All times are GMT +1. The time now is 01:51 PM.

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"