Can you space two texts in centimeters in the same Excel cell?

0

As shown in the figure below. I need to tabulate in a single cell two texts so that from one cell to the other (from the same column) the texts on the right are perfectly aligned (see column D).

Intheupperpartofthefigure:exampleoftheresultthatIhavewiththemisalignmentofpagenumbers(columnD).

Atthebottom:thesameexcerpt,butwiththeformulasapplied.

IncellD2thenumberofspacesinthedistanceincharactersthatthesecondtextshouldbealignedisgiven.Hereideallytheyshouldbe"centimeters" or something like that and not spaces.

I know there are lots of simple ways to do this, like using two columns or a font with characters of the same size in pixels, but in my case I need to solve it like this, in a single cell and with any font that you want to apply .

This should be added to a complex worksheet that dynamically handles a report that has links to several other worksheets and features. The text handling is dynamic, that is, if you mark a topic or unmark, the entire report is automatically adjusted, the topic numbers are modified and the pages on which they are displayed can be changed as well. For example, a "4. COSTS" topic on page 34, depending on what is done, may be the topic "6. COSTS" and listed on page 59, and there are numerous items with topics and subtopics. The size of the cells and their columns should preferably not be modified.

I tried a few ways to get the result, I researched, but to no avail.

If you can do it, even if it is complex, it should be better and faster to study and restructure this worksheet.

Thank you in advance for the contributions or comments.

    
asked by anonymous 18.03.2017 / 14:24

1 answer

0

The solution I am presenting is not exactly how I would like it, but solved the problem simply and straightforwardly.

I added a TextBox (ActiveX control) at the end and on each line of the home page that can have text to reference the page (with the same amount of lines in my case, between the controls). >

In the properties I passed to transparent, I aligned all and changed the font to the same active in Excel (because I believe there is no way to do this automatically, recognize the source of the linked cell) I have grouped everything so that I can easily adjust the block sideways for when it is the case.

In the LinkedCell property, I pointed to the cell with the text of the page number being displayed.

In this way, lines that have page numbers have their TextBox elements dynamically updated, just like the rest are "empty" and do not appear when they do not have page numbers.

See the example below:

InthefirstlineIhighlightedthe%w/o%eachlinehasattheend,aswellasthelasttwolines,toshowthattheyareallthere,theotherlinesappearastheyshouldappearforprinting(thecontrolsaretheretoo).Becausetheyaretransparentandhavenotext,infactthetwoendlinesappear"blank" as they should appear, here I highlighted to better exemplify.

That's it!

    
20.03.2017 / 12:46