Type Mismatch

vvershas

New Member
Joined
Apr 6, 2002
Messages
20
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?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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
 
Upvote 0

Forum statistics

Threads
1,214,411
Messages
6,119,346
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top