Descriptive title generation using Excel VBA

EAG1

New Member
Joined
Feb 12, 2021
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am trying to generate descriptive titles from the following data which have a character limit of 80 characters. The output needs to be the "Title" + "Additional Words" + "For" + "Brand" + "Numbers" + "Type" and in this order. The separator needs to be a space. The reason we cannot use text join or concatenate is because the "Numbers" cell is a generally longer than 80 characters and it need splitting over multiple titles. Examples of the output can be found below following the table of data.

In column 8 I have added all the relevant data together minus the "Numbers" data so I can calculate the number of characters left from the max of 80. Example on the first item we have 30 Characters left so the "numbers" section will need splitting into 30 Characters or less depending on where the separator falls. Numbers cannot be split in between separators.

SKUTitleAdditional WordsForBrandNumbersTypeOutput Minus NumbersMax CharactersCharacters of output minus numbersLeft
65442​
Table & ChairsDining Kitchen RoomforRehau384;385;484;485XL;495;584;585;684;685;784;785;884;885ModelTable & Chairs Dining Kitchen Room for Rehau Model
80​
50​
30​
65454​
TrainersSports ShoesforNike2610;2910;3610;3910;4110;4610;5110;5610;5635;5640;5640;6410;6610;6635;6640;6640;6710;6810;7410;7610;7635;7710;7740;7740;7810;7840;7840;7910;8000;8210;8240;8240;8260;8340;8340;8360;8530;8560;8630;8700;8730;8830ModelTrainers Sports Shoes for Nike Model
80​
36​
44​
75885​
MirrorHead WingforPartsmax115 Puma;125 Puma;130 Puma;140 Puma;145 Puma;150 Puma;155 Puma;160 Puma;165 Puma;170 Puma;180 Puma;185 Puma;195 Puma;200 Puma;210 Puma;MXM100;MXM110;MXM115;MXM120;MXM120 Pro;MXM130;MXM130 Pro;MXM135;MXM140;MXM140 Pro;MXM155;MXM155 Pro;MXM175;MXM175 Pro;MXM190ModelMirror Head Wing for Partsmax Model
80​
35​
45​


The output required can be seen below. Each title consisting of 80 characters or less.


SKUOutputCount
65442​
Table & Chairs Dining Kitchen Room for Rehau 384 385 484 485XL 495 584 585 Model
80​
65442​
Table & Chairs Dining Kitchen Room for Rehau 684 685 784 785 884 885 Model
74​
65454​
Trainers Sports Shoes for Nike 2610 2910 3610 3910 4110 4610 5110 5610 Model
76​
65454​
Trainers Sports Shoes for Nike 5635 5640 5640 6410 6610 6635 6640 6640 Model
76​
65454​
Trainers Sports Shoes for Nike 6710 6810 7410 7610 7635 7710 7740 7810 Model
76​
65454​
Trainers Sports Shoes for Nike 7840 7840 7910 8000 8210 8240 8240 8260 Model
76​
65454​
Trainers Sports Shoes for Nike 8340 8340 8360 8530 8560 8630 8700 8730 Model
76​
65454​
Trainers Sports Shoes for Nike 8830 Model
41​
75885​
Mirror Head Wing for Partsmax 115 Puma 125 Puma 130 Puma 140 Puma 145 Puma Model
80​
75885​
Mirror Head Wing for Partsmax 150 Puma 155 Puma 160 Puma 165 Puma 170 Puma Model
80​
75885​
Mirror Head Wing for Partsmax 180 Puma 185 Puma 195 Puma 200 Puma 210 Puma Model
80​
75885​
Mirror Head Wing for Partsmax MXM100 MXM110 MXM115 MXM120 MXM120 Pro Model
74​
75885​
Mirror Head Wing for Partsmax MXM130 MXM130 Pro MXM135 MXM140 MXM140 Pro Model
78​
75885​
Mirror Head Wing for Partsmax MXM155 MXM155 Pro MXM175 MXM175 Pro MXM190 Model
78​

Any help on this would be much appreciated.

Thanks.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
In what cells does the data come from and in what cells are they going to?
 
Upvote 0
In what cells does the data come from and in what cells are they going to?
Hi @ZMyrrh

Sorry, please see screenshots below. I currently have the input data on sheet1 and the output data on sheet2.

1661184890003.png



1661184970665.png


Let me know if you require anymore information.
 
Upvote 0
@Fluff would you be able to help with this as well by any chance? Appreciate your help.
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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