![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
HI
I changed the datatype to Text for the whole spreadsheet but when I try to merge any cells I get the error 'different data types' What I have is about 6 fields which contain address details as some of the addresses are shorter that onthers I have gaps for example one address could be add1 add2 add3 add4 add5 zip with all fields populated another address could be add1 add2 add3 add4 add5 zip with add5 left blank and some addresses would have different fields missing I dont want to merger all the fields in to one, I just want the details in HI I changed the datatype to Text for the whole spreadsheet but when I try to merge any cells I get the error 'different data types' What I have is about 6 fields which contain address details as some of the addresses are shorter that onthers I have gaps for example one address could be add1 add2 add3 add4 add5 zip with all fields populated another address could be add1 add2 add3 add4 add5 zip with add5 left blank and some addresses would have different fields missing I dont want to merger all the fields in to one, I just want the details in cosecutive fields. I tried merging cells but it didnt work so is there any maco/piece of code I can use to do this? Thanks in fields. I tried merging cells but it didnt work so is there any maco/piece of code I can use to do this? Thanks in advance |
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
You don't have to change the data type at all.
Lets say that you have add1 add2 add3 add4 add5 zip in A2:F2 In G2 enter: =A2&" "&B2&" "&C2&" "&D2&" "&E2&" "&F2 will cocatenate ("merge") into a single field. |
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Posts: 14
|
Thats Cool
but not exactly what I wanterd to do first adress add1 add2 add3 add4 add5 add6 Myhouse 10 East Rd Eastly York 123 second address add1 add2 add3 add4 add5 add6 20 West Rd York 123 I want the layot as the first address but the second I dont want empty ceels, I want the data to be empty I want it to look like first adress add1 add2 add3 add4 add5 add6 Myhouse 10 East Rd Eastly York 123 second address add1 add2 add3 add4 add5 add6 20 West Rd York 123 is there a way of doing this without manually changing every record thanks again |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
[ This Message was edited by: Aladin Akyurek on 2002-03-03 03:28 ] |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|