Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default VBA Help, cant figure out why it dosn't work.

hello all, I was wondering If I could get a little help with this line, i
cant figure out why it wont work. I use the same code on a different workbook
with just the columns changed and it works fine..


j = ActiveSheet.Evaluate("=SumProduct(--(A1:A3000=" & _
CLng(CDate(nStuff)) & "),--(IsNumber(Find(""AH"",I1:I3000))))")

however, in the same macro, these work correctly:

i = Application.CountIf(.Columns(1), nStuff)
k = Application.SumIf(.Columns(1), nStuff, .Columns(11))

so I know that the nstuff value is correct.. any help would be greatly
appreciated. Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VBA Help, cant figure out why it dosn't work.

What does j equal when you run it? Or does the code blow up?

If j = 0, then maybe you don't have upper AH in I1:I3000 of that activesheet.
The worksheet function =Find() is case sensitive. You can use =Search() if you
have AH, ah, Ah or aH to match.

Or maybe A1:A3000 don't have real dates in them--or nstuff isn't really a date?



Michael A wrote:

hello all, I was wondering If I could get a little help with this line, i
cant figure out why it wont work. I use the same code on a different workbook
with just the columns changed and it works fine..

j = ActiveSheet.Evaluate("=SumProduct(--(A1:A3000=" & _
CLng(CDate(nStuff)) & "),--(IsNumber(Find(""AH"",I1:I3000))))")

however, in the same macro, these work correctly:

i = Application.CountIf(.Columns(1), nStuff)
k = Application.SumIf(.Columns(1), nStuff, .Columns(11))

so I know that the nstuff value is correct.. any help would be greatly
appreciated. Thanks!


--

Dave Peterson
Reply
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
A What-if scenario changing one figure to work out another ExcelNovice1 Excel Worksheet Functions 4 October 3rd 08 01:35 AM
Function dosn't work in Excel 2007 but did in 2003 Harding Excel Worksheet Functions 1 February 12th 08 04:05 PM
MS querry dosn't work when importing from DB2 after upgrading to 2 Harding Excel Worksheet Functions 0 February 12th 08 01:33 PM
Can't figure out why Macro wont work???? Krefty Excel Worksheet Functions 0 November 2nd 07 12:06 AM
File dosn't always close? Karl Treier Excel Programming 2 August 5th 04 06:03 PM


All times are GMT +1. The time now is 11:53 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"