![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Australia
Posts: 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? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
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 |
|
New Member
Join Date: Apr 2002
Location: Australia
Posts: 20
|
Ta Tom,
I've mailed you the spreadsheet. Could you please run it and check the error. Cheers |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
The Last Hurdle?
I chuckle! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|