Results 1 to 3 of 3

Thread: Resize a Rectangle shape according to the total number of row using VBA

  1. #1
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    14

    Resize a Rectangle shape according to the total number of row using VBA

    Hi All,

    Thanks for all the fast reply of my previous threads.
    You people are so helpful.
    Now this time i need a code or function which resize a ractangle according to the no of rows data in excel using VBA.

    Thanx in Advance.

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Code:
    Public Sub ResizeShapeOverRange(shp As Object, rngRange As Range)
    
        shp.Height = rngRange.Height
        shp.Width = rngRange.Width
        shp.Top = rngRange.Cells(1).Top
        shp.Left = rngRange.Cells(1).Left
        
    End Sub
    
    Sub Callit()
    
        Call ResizeShapeOverRange(ActiveSheet.Shapes(1), Range("C5:D10"))
        'OR
        Call ResizeShapeOverRange(ActiveSheet.Shapes("NameOfShape"), Range("C5:D10"))
    
    End Sub
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    14
    Thanx its working !!!!!!!!!!!!! Woooohoooooo

Similar Threads

  1. Replies: 3
    Last Post: 06-01-2013, 11:31 AM
  2. Replies: 7
    Last Post: 04-21-2013, 07:50 PM
  3. Replies: 8
    Last Post: 12-28-2012, 11:10 AM
  4. Insert 'n' number Rows after any specified row no.
    By LalitPandey87 in forum Excel Help
    Replies: 2
    Last Post: 11-08-2011, 08:59 AM
  5. Add Shape With Hyperlink To Another Sheet
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 07-30-2011, 04:51 AM

Posting Permissions

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