lost gridlines 
Author Message
 lost gridlines

When i give a number of cel color 38
     With Selection.Interior
           .ColorIndex = 38
           .Pattern = xlSolid
           .PatternColorIndex = xlAutomatic
      End With

And then give them no color (color 0)
     With Selection.Interior
           .ColorIndex = 0
           .Pattern = xlSolid
           .PatternColorIndex = xlAutomatic
      End With

I lose my grid (if thats how its called)
(i can not see the standard lines around a cell)

What am i doeing wrong?

Gretings Hans



Sun, 22 May 2005 17:26:49 GMT  
 lost gridlines

nothing. when you set a cell's color - either directly or in code - you also need to set the cells borders too

Sub SetBorders(rnf As Range)
    With rng
        .Borders(xlDiagonalDown).LineStyle = xlNone
        .Borders(xlDiagonalUp).LineStyle = xlNone
        .Borders(xlInsideVertical).LineStyle = xlNone
        .Borders(xlInsideHorizontal).LineStyle = xlNone
    With .Borders(xlEdgeLeft)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
     End With
     With .Borders(xlEdgeTop)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
     End With
     With .Borders(xlEdgeBottom)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
     End With
     With .Borders(xlEdgeRight)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
     End With
    End With
End Sub

--
Patrick Molloy
Microsoft Excel MVP
----------------------------------

  When i give a number of cel color 38
       With Selection.Interior
             .ColorIndex = 38
             .Pattern = xlSolid
             .PatternColorIndex = xlAutomatic
        End With

  And then give them no color (color 0)
       With Selection.Interior
             .ColorIndex = 0
             .Pattern = xlSolid
             .PatternColorIndex = xlAutomatic
        End With

  I lose my grid (if thats how its called)
  (i can not see the standard lines around a cell)

  What am i doeing wrong?

  Gretings Hans



Sun, 22 May 2005 18:21:27 GMT  
 lost gridlines

sorry
problem solved

Greetings hans

PS solution is:
Selection.Interior.ColorIndex = xlNone

  When i give a number of cel color 38
       With Selection.Interior
             .ColorIndex = 38
             .Pattern = xlSolid
             .PatternColorIndex = xlAutomatic
        End With

  And then give them no color (color 0)
       With Selection.Interior
             .ColorIndex = 0
             .Pattern = xlSolid
             .PatternColorIndex = xlAutomatic
        End With

  I lose my grid (if thats how its called)
  (i can not see the standard lines around a cell)

  What am i doeing wrong?

  Gretings Hans



Sun, 22 May 2005 18:21:25 GMT  
 lost gridlines

well setting the colorindex to nothing isn't a solution as such. The problem we answered was how to show the gridlines when a color IS set. You just cheated by removing the color <VBG>

--
Patrick Molloy
Microsoft Excel MVP
----------------------------------

  sorry
  problem solved

  Greetings hans

  PS solution is:
  Selection.Interior.ColorIndex = xlNone

    When i give a number of cel color 38
         With Selection.Interior
               .ColorIndex = 38
               .Pattern = xlSolid
               .PatternColorIndex = xlAutomatic
          End With

    And then give them no color (color 0)
         With Selection.Interior
               .ColorIndex = 0
               .Pattern = xlSolid
               .PatternColorIndex = xlAutomatic
          End With

    I lose my grid (if thats how its called)
    (i can not see the standard lines around a cell)

    What am i doeing wrong?

    Gretings Hans



Sun, 22 May 2005 18:51:22 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. lost gridlines

2. Losing gridlines when printing.

3. Lost gridlines

4. lost gridlines

5. Lost Gridlines

6. Opening HTML in Excel - I lose all the gridlines

7. Gridlines are lost when converting Lotus123 to Excel 97

8. Show Gridlines does not show bottom most gridline

9. Show Gridlines does not show bottom most gridline

10. Gridlines - Can't get rid of gridlines


 
Powered by phpBB® Forum Software © phpBB Group