ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Draw Diagonal Cell by Cell (https://www.excelbanter.com/excel-programming/398967-draw-diagonal-cell-cell.html)

smandula

Draw Diagonal Cell by Cell
 
Is it possible to activate any cell by doubleclicking it,
for the purpose of drawing a diagonal line in the next
cell higher and to the left, and continue upwards diagonally
until a margin is hit (such as column A, or horizonally row A.. Z...

A B C D E F
1 \
2 \
3 \
4 \
5 123

Similarly, ascending to the right

A B C D E F G
1 /
2 /
3 /
4 /
5 123

From any cell


With Thanks


joel

Draw Diagonal Cell by Cell
 
Yes you can.

ActiveSheet.Shapes.AddLine(171.75, 260.25, 221.25, 275.25).Select
expression.AddLine(BeginX, Beginy, EndX, EndY)

Each cell has a left and top parameter that you can use for the begin and
end points.

"smandula" wrote:

Is it possible to activate any cell by doubleclicking it,
for the purpose of drawing a diagonal line in the next
cell higher and to the left, and continue upwards diagonally
until a margin is hit (such as column A, or horizonally row A.. Z...

A B C D E F
1 \
2 \
3 \
4 \
5 123

Similarly, ascending to the right

A B C D E F G
1 /
2 /
3 /
4 /
5 123

From any cell


With Thanks



smandula

Draw Diagonal Cell by Cell
 
Thanks for replying.

However, I need the draw line to be cell by cell.
Therefore, some looping need be employed.



All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com