Results 1 to 6 of 6

Adding Header via Add-In - Compile error: Type Mismatch

Threaded View

koticphreak Adding Header via Add-In -... 07-30-2009, 01:09 PM
koticphreak Re: Adding Header via Add-In... 07-30-2009, 06:31 PM
Andy Pope Re: Adding Header via Add-In... 07-31-2009, 05:25 AM
koticphreak Re: Adding Header via Add-In... 07-31-2009, 12:50 PM
Andy Pope Re: Adding Header via Add-In... 08-01-2009, 06:32 AM
koticphreak Re: Adding Header via Add-In... 08-01-2009, 12:13 PM
  1. #1
    Forum Contributor
    Join Date
    09-13-2008
    Location
    Los Angeles, CA
    MS-Off Ver
    365
    Posts
    120

    Adding Header via Add-In - Compile error: Type Mismatch

    I wrote a macro that basically adds 5 lines at the beginning and puts in a heading (don't want to use headers). The macro worked flawlessly, then i decided to add it to my add-in and now I get the compile error "type mismatch" for the following line

    Range("A1").Select
    - the "A1" is highlighted in particular.

    Here is the entire code:

    Rows("1:5").Select
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "1"
    With Selection.Font
    .Color = -16776961
    .TintAndShade = 0
    End With
    Selection.Font.Bold = True
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "2"
    Selection.Font.Bold = True
    Range("A3").Select
    ActiveCell.FormulaR1C1 = "3"
    Selection.Font.Bold = True
    Range("A4").Select
    Selection.NumberFormat = "mm/dd/yy"
    ActiveCell.FormulaR1C1 = "4"
    With Selection
    .HorizontalAlignment = xlLeft
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Selection.Font.Bold = True
    Range("A5").Select
    ActiveCell.FormulaR1C1 = "5"
    Selection.Font.Bold = True
    With Selection.Font
    .Color = -16776961
    .TintAndShade = 0
    End With
    Any help will be greatly appreciated!
    Last edited by koticphreak; 08-01-2009 at 12:13 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1