Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 44
Default Problem width width-property

Hi

I'd like to change a line (shapes-object). This works fine when line goes
from up-left to down-right, but I'm not able to draw a line from up-right to
down-left. In this case the width-property would be minus, but this is not a
valid value. How to do?

Tom


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Problem width width-property

1. You can delete the line and redraw it.
2. You can record a macro & change the line to see how Excel does it. I did
it I couldn't figure it out.

I think option 1 is easier.

"Tom" wrote in message
...
Hi

I'd like to change a line (shapes-object). This works fine when line goes
from up-left to down-right, but I'm not able to draw a line from up-right

to
down-left. In this case the width-property would be minus, but this is not

a
valid value. How to do?

Tom




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Problem width width-property

I added 2 lines from the drawing toolbar on to a fresh worksheet. I could
manipulate the existing lines by going through the Lines collection or the
Shapes collection.

Maybe there's something in here that helps:

Option Explicit
Sub testme01()
Dim myLine1 As Line
Dim myLine2 As Shape
Dim myLine3 As Shape
Dim myLine4 As Line

With ActiveSheet
Set myLine1 = .Lines("Line 1")
myLine1.ShapeRange.Flip msoFlipHorizontal

Set myLine2 = .Shapes("line 2")
myLine2.Flip msoFlipVertical

With .Range("b3:c9")
Set myLine3 = .Parent.Shapes.AddLine _
(beginx:=.Left, _
beginy:=.Top, _
endx:=.Left + .Width, _
endy:=.Top + .Height)

'myLine3.Flip msoFlipHorizontal
myLine3.Name = "Line 3"
End With

With .Range("e3:g9")
Set myLine4 = .Parent.Lines.Add _
(x1:=.Left, _
y1:=.Top, _
x2:=.Left + .Width, _
y2:=.Top + .Height)

'myLine4.Flip msoFlipHorizontal
myLine4.Name = "Line 4"
End With
End With
End Sub

the Lines stuff is a hold over from xl95. They're a "hidden" element of xl97
and greater. You can still find info within the Object browser if you want.
But I'd recommend that you use the shapes collection. You'll be able to get
help out of VBA's help system.


Tom wrote:

Hi

I'd like to change a line (shapes-object). This works fine when line goes
from up-left to down-right, but I'm not able to draw a line from up-right to
down-left. In this case the width-property would be minus, but this is not a
valid value. How to do?

Tom


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Cell Width WITHOUT changing Column width dww701 Excel Discussion (Misc queries) 1 January 12th 09 10:52 PM
Concvert Full Width Katakana characters into Half Width Katakana C Mandeep Dhami Excel Discussion (Misc queries) 0 November 30th 07 06:47 AM
Data-Validation-List-Width of list must be colomn width, is this possible Luc Excel Worksheet Functions 2 March 5th 07 05:49 PM
ASC() does not convert full-width to half-width letters (Exel 2003 DY Excel Worksheet Functions 0 January 27th 07 01:34 PM
How to make cell width different than the column width it lies in John Excel Discussion (Misc queries) 2 September 11th 06 10:41 PM


All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"