简体   繁体   English

Excel:将数字添加到合并单元格的框的右上角

[英]Excel: Add number to upper right corner of box of merged cells

I have an excel form which displays a six generation family pedigree chart. 我有一个Excel表格,其中显示了六代家庭谱系图。 Each box for a person's data is merged together from 3 columns and 7 rows. 一个人的数据的每个框从3列和7行合并在一起。 4 lines of text fit into each box, the 1st line is name, the 2nd birth date and place, the 3rd marriage date and place and the 4th death date and place. 每个方框中包含4行文字,第一行是姓名,第二出生日期和地点,第三结婚日期和地点以及第四死亡日期和地点。

The rightmost two columns are the triple great grandparents of the root person and sometimes a 2nd chart is needed to show their ancestors. 最右边的两列是原始人的三重曾祖父母,有时还需要第二张图表来显示其祖先。 The 2nd chart tile is Chart mm-nn where mm is the chart number where the person appears as a GGG grandparent and nn is their number in that chart. 第二个图表磁贴是“图表mm-nn”,其中mm是该人作为GGG祖父母出现的图表编号,而nn是该图表中他们的编号。

How can I put a number in the upper right corner of these boxes in my chart? 如何在图表中这些框的右上角放置一个数字?

I thought of appending the number to the person's name and flush it right. 我想到了在该人的姓名后附加数字并将其正确冲洗掉。 If possible, it must be with some exotic format string. 如果可能,它必须带有一些特殊格式的字符串。 But each box has 4 text lines and the flush right formatting needs only apply to the 1st. 但是每个框有4个文本行,刷新权限格式设置仅适用于第一个。

Perhaps make the numbers as little graphics and overlay them? 也许使数字尽可能少地图形并覆盖它们? Chop up the base cells even smaller and merge them into 4 separate lines with the 1st line shorter than the others with a small number box at the end of it? 将基础单元切得更小,然后将其合并为4条单独的行,第一行比其他行的末尾带有一个小数字的框短吗?

Ideas? 想法?

Jim 吉姆

The short answer to your question is: no, that's not possible. 您问题的简短答案是:不,那是不可能的。 This is Excel not MS Word. 这是Excel而不是MS Word。 Hence, you can set any given cell only to be left-justified or right-justified . 因此,您只能将任何给定的像元设置为left-justifiedright-justified You cannot have both for one cell. 一个单元格不能同时拥有。

Yet, maybe any of the following work-around might be of help in your case. 但是,以下任何变通办法可能会对您有帮助。 Of course, I can't be sure since you haven't provided any screenshots of the desired out-come (like a mock-up). 当然,我不确定,因为您还没有提供所需结果的任何屏幕截图(例如模型)。 But here we go: 但是,我们开始:

This is where you are coming from. 这就是你来自哪里。 A merged box of three columns by seven rows containing four lines of text. 三列乘七行的合并框,其中包含四行文本。

在此处输入图片说明

(1) One solution might be to have three different merged areas. (1)一种解决方案可能是具有三个不同的合并区域。 The following example consists of three merged areas. 以下示例由三个合并区域组成。 The first two rows and the first two columns make up the name. 前两行和前两列组成名称。 The last column on the first two rows is merged to contain the number and the rest is one merged box again containing the dates and the places. 前两行的最后一列被合并以包含数字,其余的是一个合并的框,再次包含日期和位置。

在此处输入图片说明

Note, that you can only see the difference to the original since I selected in this example the top right merged area (consisting of the number only). 请注意,由于我在此示例中选择了右上角的合并区域(仅由数字组成),因此您只能看到与原始图像的区别。 Otherwise, there wouldn't be any (visually apparent) difference. 否则,就不会有任何(视觉上的区别)差异。

(2) Another solution could be to manually insert as many spaces after the name as necessary to make it seem as if it were right-justified . (2)另一个解决方案是在名称后手动插入尽可能多的空格,以使其看起来好像是right-justified The problem here is (of course) that this changes with the font, the font-size, if the font is bold (or italic) or not, and also the current zoom-factor for the sheet. 这里的问题是(当然)这会随着字体,字体大小(是否字体是粗体(或斜体))以及当前工作表的缩放系数而变化。 Hence, this solution would soon wear you out as you would have to manually adjust all the cells constantly. 因此,该解决方案很快就会使您疲惫,因为您必须不断地手动调整所有单元。 I just wanted to point out this solution for the sake of completeness. 为了完整起见,我只想指出此解决方案。

在此处输入图片说明

(3) The following solution consists of a text box shape on top of the cell. (3)以下解决方案由单元格顶部的text box形状组成。 So, basically I am leaving your original cell (consisting of three columns and seven rows) as is and simply put a shape on top of that cell. 因此,基本上,我将原样保留您的原始单元格(由三列和七行组成),并在该单元格的顶部放置一个形状。 The following screenshot shows the result in the top part and the text box being selected in the bottom part (so you can see how this one comes together). 以下屏幕截图在顶部显示了结果,而在底部显示了文本框(因此您可以看到这是如何组合在一起的)。

在此处输入图片说明

(4) The following work-around is probably the solution you've been looking for and you want to go with. (4)以下解决方法可能是您一直在寻找并且想要使用的解决方案。 This one is moving away from the cells on the sheet and relies only on text-boxes which are shown on top of the sheet (and thus on top of the cells). 这一个正在远离工作表上的单元格, 依赖于在工作表顶部(因此在单元格顶部)显示的文本框。 Here you can "merge" several text boxes into a group. 在这里,您可以将几个文本框“合并”到一个组中。 The group will move and size as a whole. 该小组将移动并扩大规模。 At the same time this group consists of several text boxes and as such may consist of left-justified text boxes and right-justified text boxes as you can see in the screencast below. 同时,该组由几个文本框组成,因此可能包含left-justified文本框和right-justified文本框,如下面的截屏所示。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM