Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shape Pattern (Excel 2003)

    hello all,

    i would ask You kindly for some support to change my shape patterns via cell entry.
    I know, that it could be tricky to do so, because i tried it for a long time to find a solution. I still can change shapes height, width, and lineproperties,
    but to change the pattern seems to be impossible.....
    does anyone know how to solve this,

    stefan
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shape Pattern (Excel 2003)

    The pattern types are numbers in the range 1...48. You could either enter the numbers, as you do for the line style in column N, or you could enter the names (such as msoPattern5Percent) and use a Select Case statement to translate the names to the corresponding numbers.
    For example if you enter the numbers:

    curShape.Fill.Patterned konfigSheet.Cells(shapeZeile, 15)

    or if you enter the names:

    Dim intPattern As Integer
    Select Case konfigSheet.Cells(shapeZeile, 15)
    Case "msoPattern5Percent"
    intPattern = 1
    Case "msoPattern10Percent"
    intPattern = 2
    ...
    End Select
    curShape.Fill.Patterned intPattern

  3. #3
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape Pattern (Excel 2003)

    hi Hans,

    thanks for Your quick reply. if i try it via numbers i have to change the pattern fill later by hand, if i dont want a pattern fill...
    so it seems for me only suitable if i want a pattern instead of solid fill?

    stefan

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shape Pattern (Excel 2003)

    To remove a pattern, use

    curShape.Fill.Solid

  5. #5
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape Pattern (Excel 2003)

    ok, i guess its best to use it with an if case to get the possibility to take 0 as solid fill.
    thanks again hans,
    stefan

Posting Permissions

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