Announcement

Collapse
No announcement yet.

Center Picture In Cell

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Center Picture In Cell



    I have a bitmap in a cell..

    I can size it but am having trouble trying to center the bitmap in the cell..

    is there a way to do this ?

  • #2


    Re: Centering A Picture In A Cell

    This function takes a shape and a range of cell(s) over which to center the shape.

    Sub aTest()

    CenterMe ActiveSheet.Shapes(1), Range("D9")

    End Sub

    Sub CenterMe(Shp As Shape, OverCells As Range)

    With OverCells
    Shp.Left = .Left + ((.Width - Shp.Width) / 2)
    Shp.Top = .Top + ((.Height - Shp.Height) / 2)
    End With
    End Sub

    Cheers
    Andy

    Comment

    Working...
    X