scoopypaw said:
Hello,
Is there a way to split a cell diagonally ? I would like to have 2 data points in a cell that have a diagonal split so it looks like that are still in the same cell with just a diagonal line between them. I also need to be able to still sum the 2 data points.
Yes this is possible but you really ought to consider changing your workbook design because it is more trouble than it's worth to maintain.
Expanding on Seti's approach, here are the steps, assuming cell A1, and data points of 5 and 8 - -
Step 1
In cell A1, enter "58" (without the quotes).
Step 2
Select cell A1, and in the formula bar place the cursor beteewn the 5 and the 8.
Step 3
Press Alt+Enter
twice .
Step 4
Press Ctrl+Enter, which will accept the changes and keep cell A1 active.
Step 5
From the worksheet menu, click Format > Cells > Border tab.
Step 6
Select the left diagonal border. That is, select the border that extends from the upper left corner to the lower right corner.
Step 7
While still in the Format Cells dialog, select the Alignment tab, and for
both the Horizontal
and Vertical text alignment fields, select "Justify".
Step 8
Click OK to exit the Format Cells dialog.
Step 9
Place your cursor in the formula bar again at the beginning of the value so it is before the 5, and hit the spacebar as many times as necessary (depending on column width) to have that 5 character be in the upper right half of the cell.
Step 10
At this point the cell looks the way you want it to, so now we need to parse the two values so you can use them in calculations.
Step 10a
Worksheet formulas:
X coordinate
=LEFT(SUBSTITUTE(TRIM($A$1),CHAR(10),"")-1)+0
Y coordinate
=RIGHT($A$1,1)+0
or
Step 10b
Here is a VBA approach so you can use the variables in VBA calculations:
Sub Test1()
Dim MyStr$, Xcoor$, Ycoor$
MyStr = Application.Substitute(Range("A1"), " ", "")
Xcoor = Mid(MyStr, 1, Len(MyStr) - 3)
Ycoor = Right(Range("A1"), 1)
MsgBox _
"X coordinate: " & Xcoor & vbCrLf & _
"Y coordinate: " & Ycoor
End Sub
This is probably not bulletproof and as I said, you'd be better off using separate cells, but it's one possible thought process in addition to the preceding responses to your question.