Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function CellsGrid(rngCells As Range)
' Procedure:    CellsGrid
' Description:  GRID the selected number of cells.
' Copyright:    Chris Greaves Inc.
' Inputs:       None
' Returns:      None
' Assumes:      Nothing
' Side Effects: The current table formatting may change.
' Tested:       By the calls below.
    If rngCells.Information(wdWithInTable) Then
        With rngCells.Cells
            With .Borders(wdBorderLeft)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth075pt
                .ColorIndex = wdAuto
            End With
            With .Borders(wdBorderRight)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth075pt
                .ColorIndex = wdAuto
            End With
            With .Borders(wdBorderTop)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth075pt
                .ColorIndex = wdAuto
            End With
            With .Borders(wdBorderBottom)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth075pt
                .ColorIndex = wdAuto
            End With
            If rngCells.Rows.Count > 1 Then
                With .Borders(wdBorderHorizontal)
                    .LineStyle = wdLineStyleSingle
                    .LineWidth = wdLineWidth075pt
                    .ColorIndex = wdAuto
                End With
            Else
            End If
            If rngCells.Columns.Count > 1 Then
                With .Borders(wdBorderVertical)
                    .LineStyle = wdLineStyleSingle
                    .LineWidth = wdLineWidth075pt
                    .ColorIndex = wdAuto
                End With
            Else
            End If
            .Borders.Shadow = False
        End With
    Else
        Call errMustBeInTable
    End If
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function CellsGrid(rngCells As Range)
' Procedure:    CellsGrid
' Description:  GRID the selected number of cells.
' Copyright:    Chris Greaves Inc.
' Inputs:       None
' Returns:      None
' Assumes:      Nothing
' Side Effects: The current table formatting may change.
' Tested:       By the calls below.
    If rngCells.Information(wdWithInTable) Then
        With rngCells.Cells
            With .Borders(wdBorderLeft)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth075pt
                .ColorIndex = wdAuto
            End With
            With .Borders(wdBorderRight)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth075pt
                .ColorIndex = wdAuto
            End With
            With .Borders(wdBorderTop)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth075pt
                .ColorIndex = wdAuto
            End With
            With .Borders(wdBorderBottom)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth075pt
                .ColorIndex = wdAuto
            End With
            If rngCells.Rows.Count > 1 Then
                With .Borders(wdBorderHorizontal)
                    .LineStyle = wdLineStyleSingle
                    .LineWidth = wdLineWidth075pt
                    .ColorIndex = wdAuto
                End With
            Else
            End If
            If rngCells.Columns.Count > 1 Then
                With .Borders(wdBorderVertical)
                    .LineStyle = wdLineStyleSingle
                    .LineWidth = wdLineWidth075pt
                    .ColorIndex = wdAuto
                End With
            Else
            End If
            .Borders.Shadow = False
        End With
    Else
        Call errMustBeInTable
    End If
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1