Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Type Mismatch

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hello,
    I get a type mismatch whenever I start my spreadsheet.

    MODULE1
    Public OldPoolValue562
    Public NextColumnAvailable562 As Long

    THIS WORKBOOK
    Private Sub Workbook_Open()
    OldPoolValue562 = Sheet1.Range("C3")
    NextColumnAvailable562 = 4
    OldPoolValue563 = Sheet2.Range("C3")
    NextColumnAvailable563 = 4
    OldPoolValue564 = Sheet3.Range("C3")
    NextColumnAvailable564 = 4
    End Sub

    SHEET1
    Sub Worksheet_Calculate()
    Dim NewPoolValue562
    NewPoolValue562 = Range("C3").Value
    If NewPoolValue562 > OldPoolValue562 Then
    '**debug highlights above for mismatch
    OldPoolValue562 = NewPoolValue562
    Range(Cells(5, NextColumnAvailable562), Cells(29, NextColumnAvailable562)).Value = _
    Range(Cells(5, 3), Cells(29, 3)).Value
    NextColumnAvailable562 = NextColumnAvailable562 + 1
    Else
    Exit Sub
    End If
    End Sub

    Cell C3 = "#N/A" before external data kicks in and updates with normal numbers.
    Can you please help?


  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey Shaun,

    Unless you have changed the worksheet around quite a bit, NewPoolValue562 = Range("C3").Value
    should be:
    NewPoolValue562 = Range("A1").Value

    Also declare in module 1 as Public:

    Public OldPoolValue563
    Public OldPoolValue564

    I wasn't able to reproduce your error with the worksheet you gave me...

    Tom




    [ This Message was edited by: TsTom on 2002-04-10 01:30 ]

  3. #3
    New Member
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Ta Tom,

    I've mailed you the spreadsheet. Could you please run it and check the error.

    Cheers

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    The Last Hurdle?
    I chuckle!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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