Why does this sub stop my menu from working?

simon_marklar

Registered User.
Local time
Today, 12:13
Joined
Apr 6, 2005
Messages
19
Code:
Private Sub myFormatCell(myRange As String, fontSize As Long, horizontalAlignment As Constants, verticalAlignment As Constants, mergeCells As Boolean)
    Range(myRange).Select
    With Selection.Font
        .Name = "Arial"
        .Size = fontSize
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With Selection
        .horizontalAlignment = horizontalAlignment
        .verticalAlignment = verticalAlignment
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .mergeCells = mergeCells
    End With
End Sub

if the whole sub is commented out i can use the menu i have made in excel. once i uncomment the sub the menu cannot find the main sub that eventually calls this one.

any ideas why? i have a feeling its to do with "As Constants" but im not sure how to get around supplying horizontal and vertical alignments without coding my own constants, and i'd rather not do that.

TIA,
%simon
 

Users who are viewing this thread

Back
Top Bottom