Consulting

Results 1 to 2 of 2

Thread: Auto-resize Shape_width

  1. #1
    VBAX Regular
    Joined
    Jan 2011
    Posts
    55
    Location

    Auto-resize Shape_width

    dear Forum,

    I am looking for your help regarding shape auto-resize based on a given cell value, for instance I am referring to a given number of stream crossing bottleneck, at the output, each stream will be treated based weight basis (refer to colored shape), so is it possible to:
    Qts-1] Resize input an output shape according to the related cells value,
    Qts-2] get the shape aligned every resize actions

    thank you sir in advance for your support,

    amrane,
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Const startTop As Double = 70
    Const startLeft As Double = 390
    Const gap As Double = 5
    Dim shp As Shape
    Dim cell As Range
    Dim heightOff As Double
    Dim i As Long
    
        With ActiveSheet
        
            For Each cell In Range("B3", Range("B3").End(xlDown))
            
                .Shapes("Rectangle " & Right$(cell.Value, 1)).Copy
                .Paste
                Selection.Name = cell.Value
                Selection.Height = cell.Offset(0, 3).Value / 3.5
                Selection.Left = startLeft
                Selection.Top = startTop + heightOff
                heightOff = heightOff + Selection.Height + gap
            Next cell
        End With
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •