#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default need a macro..

my problem is how to create a macro to combin columns(A-E), sometime in
diffrent rows.
this is the sample:
A B C D E
------------------------------------------------------------------------
N6M1(4418 271 -1G)M2(18540 FISH 2589pcs

I want a macro to combin A-E and add a (,)between each columns.
looks like this:N6M1(4418,271,-1G)M2(18540,FISH,2589pcs
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default need a macro..

You could enter this formula in F1:

=A1&","&B1&","&C1&","&D1&","&E1

and copy down the column. If you want to be left with just this,
highlight the formula cells in column F, click <copy then Edit |
Paste Special | Values (check) | OK followed by <Enter - then you can
delete columns A to E.

Hope this helps.

Pete

On Nov 23, 7:33 pm, Johnny wrote:
my problem is how to create a macro to combin columns(A-E), sometime in
diffrent rows.
this is the sample:
A B C D E
------------------------------------------------------------------------
N6M1(4418 271 -1G)M2(18540 FISH 2589pcs

I want a macro to combin A-E and add a (,)between each columns.
looks like this:N6M1(4418,271,-1G)M2(18540,FISH,2589pcs


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default need a macro..

Hi Pete,
this=A1&","&B1&","&C1&","&D1&","&E1
is samething what I did so far, but I need is a macro or formula. becouse
the information that I need to combin is in the diffrent rows everytime of my
spreadsheet . so I am looking for a macro, like look at the all columns and
find something like column D Fish(every time there is a word Fish in columns
D) and create a macro or formula to combin that row information from A-E.

anyone know how to do it pls help.

"Pete_UK" wrote:

You could enter this formula in F1:

=A1&","&B1&","&C1&","&D1&","&E1

and copy down the column. If you want to be left with just this,
highlight the formula cells in column F, click <copy then Edit |
Paste Special | Values (check) | OK followed by <Enter - then you can
delete columns A to E.

Hope this helps.

Pete

On Nov 23, 7:33 pm, Johnny wrote:
my problem is how to create a macro to combin columns(A-E), sometime in
diffrent rows.
this is the sample:
A B C D E
------------------------------------------------------------------------
N6M1(4418 271 -1G)M2(18540 FISH 2589pcs

I want a macro to combin A-E and add a (,)between each columns.
looks like this:N6M1(4418,271,-1G)M2(18540,FISH,2589pcs



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default need a macro..

Okay, do it like this:

=IF(D1="FISH",A1&","&B1&","&C1&","&D1&","&E1,"")

and copy down as before. Alternatively, put the word FISH (or any
other word) in M1 and make the formula:

=IF(D1=M1,A1&","&B1&","&C1&","&D1&","&E1,"")

Hope this helps.

Pete

On Nov 23, 8:39 pm, Johnny wrote:
Hi Pete,
this=A1&","&B1&","&C1&","&D1&","&E1
is samething what I did so far, but I need is a macro or formula. becouse
the information that I need to combin is in the diffrent rows everytime of my
spreadsheet . so I am looking for a macro, like look at the all columns and
find something like column D Fish(every time there is a word Fish in columns
D) and create a macro or formula to combin that row information from A-E.

anyone know how to do it pls help.



"Pete_UK" wrote:
You could enter this formula in F1:


=A1&","&B1&","&C1&","&D1&","&E1


and copy down the column. If you want to be left with just this,
highlight the formula cells in column F, click <copy then Edit |
Paste Special | Values (check) | OK followed by <Enter - then you can
delete columns A to E.


Hope this helps.


Pete


On Nov 23, 7:33 pm, Johnny wrote:
my problem is how to create a macro to combin columns(A-E), sometime in
diffrent rows.
this is the sample:
A B C D E
------------------------------------------------------------------------
N6M1(4418 271 -1G)M2(18540 FISH 2589pcs


I want a macro to combin A-E and add a (,)between each columns.
looks like this:N6M1(4418,271,-1G)M2(18540,FISH,2589pcs- Hide quoted text -


- Show quoted text -


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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


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