first macro second formula to combinning five columns into one column with empty cell

abdo meghari

Well-known Member
Joined
Aug 3, 2021
Messages
630
Office Version
  1. 2019
hi
I need macro to combine the five columns into one column . the column A,B,C,D ,,E,F should collect into column H with considering there are some empty cells in some columns . if there are empty cells then should move the next column and merge which contain item and merge. I put some result into column H and should be for whole items into column H .
note : should create one space for each item for each column when merging . if it's not availabel by macro then should be by formula .
Bridgestone SPLIT).xlsm
ABCDEFG
1BRANDBRANDPATTERNTTTYPEORIGIN
2BS1200R2018PRTCFG580JAP
3BS1200R2018PRTCG580THI
4BS1200R2420PRG582JAP
5BS13R22.516PRR187JAP
6BS1400R20TVSJJAP
7BS155R12CR623IND
8BS165R13CR624IND
9BS175/70R13EP150IND
10BS175/70R14EP150THI
11BS1800R25VKT**JAP
12BS185/65R14EP150IND
13BS185/65R14TECTHI
14BS185/65R15T005IND
15BS185/65R15T01JAP
16BS185/70R13EP150IND
17BS195/60R15EP150THA
18BS195/65R15EP15JAP
19BS195/65R15EP150THI
20BS195/70R15CR623JAP
21BS195R14C613JAP
22BS195R15CR623THI
23BS205/60R16T001JAP
24BS205/65R15EP150IND
25BS205/70R15CR623THI
26BS205R16CD840THI
27BS215/50R17EP300THI
28BS215/55R16EP300IND
29BS215/55R17AR20IND
30BS215/55R17GR90IND
31BS215/55R17MY-02THI
32BS215/60R16EP300THI
33BS215/60R16T005ATHI
34BS215/70R15CR623THI
35BS225/55R16EP300IND
36BS225/60R16EP300IND
37BS225/60R16T001JAP
38BS225/70R15CR623JAP
39BS225/70R16D687JAP
40BS225/70R16H005THI
41BS225/70R17D697THI
42BS235/55R17T005THA
43BS235/55R17ER300JAP
44BS235/55R18E031JAP
45BS235/60R16T01JAP
46BS245/40ZR20S001JAP
47BS245/45R17T05AJAP
48BS245/45R18EP300THI
49BS245/45R19T005JAP
50BS245/70R17684AJAP
51BS245/75R17693AJAP
52BS255/70R15CD840THI
53BS265/50R20DHPAJAP
54BS265/60R18D840JAP
55BS265/65R17D840JAP
56BS265/70R16D840THI
57BS265/70R18D684JAP
58BS275/40R18S007JAP
59BS275/40R20DsportJAP
60BS275/45R19AL01JAP
61BS275/55R17DsportJAP
62BS275/55R20AL01JAP
63BS275/65R18AL01JAP
64BS275/70R16D694JAP
65BS285/60R18DHPSJAP
66BS285/65R17R683JAP
67BS315/80R22.5R152JAP
68BS315/80R22.5R184JAP
69BS315/80R22.5R184THI
70BS315/80R22.5-18PR18PRG580JAP
71BS315/80R22.5-18PRG582THI
72BS325/95R24G582JAP
73BS385/65R22.5R164JAP
74BS385/65R22.5R164THA
75BS425/65R22.5R164JAP
76BS445/65R22.5R164JAP
77BS650R16R230JAP
78BS700R16TCFR230JAP
79BS750R1612PRR230JAP
80BS750R168PRVSJJAP
81BSLT285/75R16AT001JAP
82DT315/80R22.5TDS50THI
83DT385/65R22.5DT40THI
84FS205/65R15TZ700JAP
85FS215/55R17TZ700JAP
86
87
88
89
90
Sheet1


result in column H
Bridgestone SPLIT).xlsm
H
1MRGED
2BS 1200R20 18PR TCF G580 JAP
3BS 1200R20 18PR TC G580 THI
4BS 1200R24 20PR G582 JAP
5BS 13R22.5 16PR R187 JAP
61400R20 T VSJ JAP
Sheet1

thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How about:
varios 29ene2022.xlsm
ABCDEFGH
1BRANDBRANDPATTERNTTTYPEORIGINMERGED
2BS1200R2018PRTCFG580JAPBS 1200R20 18PR TCF G580 JAP
3BS1200R2018PRTCG580THIBS 1200R20 18PR TC G580 THI
4BS1200R2420PRG582JAPBS 1200R24 20PR G582 JAP
5BS13R22.516PRR187JAPBS 13R22.5 16PR R187 JAP
6BS1400R20TVSJJAPBS 1400R20 T VSJ JAP
7BS155R12CR623INDBS 155R12C R623 IND
8BS165R13CR624INDBS 165R13C R624 IND
9BS175/70R13EP150INDBS 175/70R13 EP150 IND
10BS175/70R14EP150THIBS 175/70R14 EP150 THI
Hoja2
Cell Formulas
RangeFormula
H2:H10H2=TRIM(A2&" "&B2&" "&C2&" "&D2&" "&E2&" "&F2)
 
Upvote 0
yes this is exactly what I want , if it's possible and you have free time to achieve it by macro I would truly appreciate it . if it's not possible I will close this thread and thank you .
 
Upvote 0
How about:

VBA Code:
Sub mergeddata()
  With Range("H2:H" & Range("A" & Rows.Count).End(3).Row)
    .Formula = "=TRIM(A2&"" ""&B2&"" ""&C2&"" ""&D2&"" ""&E2&"" ""&F2)"
    .Value = .Value
  End With
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,224,241
Messages
6,177,370
Members
452,773
Latest member
D P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top