![]() |
|
|
|
#1
|
||||
|
||||
|
The reason you're getting such errors is that you have 'Option Explicit' set (good) but you haven't declared the variables before using them (bad) - which 'Option Explicit' requires. If you check the debugger, you'll see that 'LastValue' causes the error. Nowhere have you declared LastValue and neither have you given it a value. At a guess, I'd say it should be a worksheet reference. Similarly, the same line refers to a range named 'TotalEnrolledLast' but that range doesn't exist in the workbook - and neither does 'TotalCompleteLast'.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Quote:
...how does one declare a value? Ex. "LastValue" Someone helped me write this code, I am going to try and learn how to fix it. Thank you MP |
|
#3
|
||||
|
||||
|
Assuming LastValue is a worksheet reference, you'd do that with code like:
Dim LastValue As Worksheet then you need to tell VBA which worksheet LastValue refers to, using code like: Set LastValue = Sheets("SomeWorksheetName")
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Timestamp Button Word
|
Victora | Word VBA | 1 | 12-29-2012 08:47 AM |
| Timestamp appear in reading pane | charlesmac | Outlook | 3 | 08-10-2012 02:16 AM |
| Using Date and Time (Timestamp) as a bullet | m2oswald | Word | 1 | 02-07-2012 03:41 PM |
| Convert Timestamp to GMT Time | SteadyWord | Word | 0 | 06-07-2010 06:38 AM |
Timestamp for notes in contacts?
|
boe | Outlook | 2 | 11-30-2005 04:19 PM |