LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Aplication.Worksheetfunction.MAX() Stopped Working

Greetings,

I have an invoice number generator on a UserForm run from a
CommandButton. Here is the code:

Dim rIN1 As Range
Dim rIN2 As Range

ThisWorkbook.Activate
Set rIN1 = Range("rInvNums_1st")
Set rIN2 = Range("rInvNums_List")
Input_1.Value = Application.WorksheetFunction.Max(rIN1, rIN2) + 1

With the named range "rInvNums_1st" equal to 3311000 (The first
possible invoice number minus 1) and the named range "rInvNums_List"
equal to the numbers in column C, (the list of existing invoice
numbers). This should produce the number 3311001 for the first
invoice number, instead it is producing the number 1!

When I check it with debug, debug shows the value of rIN1 as 3311000
and did not show anything for rIN2.

Anyone have any ideas as to what is wrong with this code?

Any help is greatly appreciated.

Thanks.

-Minitman
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WorksheetFunction not working correctly Ayo Excel Discussion (Misc queries) 1 July 23rd 08 05:48 PM
Add-in stopped working [email protected] Excel Programming 1 January 17th 07 05:49 PM
VB Stopped Working [email protected] Excel Worksheet Functions 1 April 28th 05 01:56 PM
How do I open an aplication and run a file in that aplication use. Cozy Excel Programming 1 March 28th 05 10:41 AM
Tab stopped working -- SCOTT-- Excel Programming 0 October 2nd 03 09:14 PM


All times are GMT +1. The time now is 10:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"