• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search results

  1. Colin Legg

    Different uses for Sumproduct() (* or -- and such)

    Bob Phillips wrote a good article on Sumproduct here: http://www.xldynamic.com/source/xld.SUMPRODUCT.html This article, which I wrote back in 2008 (! time passes so quickly !), on array formulas may also be of interest: http://www.xtremevbtalk.com/showthread.php?t=296012 In post 5 I talk about...
  2. Colin Legg

    6000 Posts ! Congratulations Sir Narayan !

    Hi Narayan, Congratulations on your 6K and thank you for sharing your knowledge and experience with us. :)
  3. Colin Legg

    Congratulations SirJB7 - 7000 posts

    Congratulations, SirJB7, on conquering yet another milestone! :cool:
  4. Colin Legg

    True False formula lying to me?

    Yep, it's a sneaky one, but they are different. The difference is the 'space' character between the X and the 4. In A3 it is a non-breaking space character. A simple way of checking this: I used the MID() function to split out all of the characters in each cell and then I used the CODE()...
  5. Colin Legg

    True False formula lying to me?

    If I copy PO BOX 123456 from your post into S2 and S3 in Excel and then compare them using =S2=S3, Excel returns TRUE. There must be a difference between the two values in your worksheet. The difference could be data type, eg. a numeric 123456 versus a string 123456 which you can check with the...
  6. Colin Legg

    method range of object _global failed.

    The first thing you should do is look in the Name manager to ensure that the names StartDateEntry and EndDateEntry both exist and that they correctly refer to ranges in the workbook. (1) If they do exist and you are getting the error, amend your VBA code and qualify both Range properties with...
  7. Colin Legg

    Scoop of a static variable

    Hi Harry, You can't change the signature of the combo_change() event handler by adding your own parameters. Furthermore, Static variables can only have procedural level scope. So, the direct answer to your question: is no, you cannot. One workaround is to use a module scope variable instead...
  8. Colin Legg

    Create an array of numbers

    I tend to use a UDF to do this. Nice, Lori, I haven't seen (2) before. That could be handy! :)
  9. Colin Legg

    What excel books members are reading / recommend

    Stick with it, I learnt a heck of a lot from that book and still regularly refer to the code examples in it. :)
  10. Colin Legg

    Congratulations Luke M: 5,000 posts!

    Nice one, Luke. Keep those quality posts coming! :)
  11. Colin Legg

    What excel books members are reading / recommend

    @sachinbizboy How are you getting on with VBA Developer's Handbook, 2nd Edition?
  12. Colin Legg

    Congrats to SirJB7 - 6000 posts

    Congratulations SirJB on yet another milestone! :)
  13. Colin Legg

    Congratulations Hui on becoming an Excel MVP!

    Congratulations, Hui!
  14. Colin Legg

    New Forum Celebration

    The new forum software is a huge improvement: congrats and well done to everyone involved on the migration.
  15. Colin Legg

    Can Lookup or match function return greater than value ?

    Another option... If you sort your pipelist so the numbers are descending: Std. Pie dia 76.2 63.5 50.8 etc... You can then use this simple formula: =INDEX(PipeList,MATCH(D2,PipeList,-1)) where D2 contains 12.1 The formula will return #N/A if D2 contains a value greater than the first...
  16. Colin Legg

    Populating a VBA array via evaluating a formula

    Hi Shrivallabha, You're on the money again. :) In my work, I always use Value2 rather than Value, unless I am concerned about date/currency. Maybe there are some other edge cases when I would prefer Value but I can't think of any off the top of my head. As noted, Value2 is faster than Value...
  17. Colin Legg

    Populating a VBA array via evaluating a formula

    That looks pretty good. :) One thing I picked up on is you need to strip the last character off the unicode string before you split it. Here's my first effort which has a few other small tweaks: Sub Test2() Dim strCharacters() As String strCharacters = CharArr(Range("A2").Value2)...
  18. Colin Legg

    Populating a VBA array via evaluating a formula

    Hi Jeff, I think there are 2 key points to TRANSPOSE(): (1) As Shrivallabha pointed out, it is a context setter for the MID() function. (2) 1D arrays in VBA are horizontal. TRANSPOSE() converts the vertical row array to a horizontal one, so the output of the evaluation is a 1D array...
  19. Colin Legg

    Populating a VBA array via evaluating a formula

    Hi Jeff, Yes, for example you can wrap it in TRANSPOSE() var = [TRANSPOSE(MID(B16,ROW(OFFSET(A1,,,LEN(B16))),1))] If you're using VBA anyway, then writing a function using native VBA methods will be more flexible, more robust and probably faster than this.
  20. Colin Legg

    Using Wildcards within Variables

    Hi, No, you can't declare a bunch of variables like that. The good news is there's a better alternative for you: use an array. If you give a bit more info then we might be able to suggest a bit more on the array (type, scope, dynamic or static, dimensions, etc), but essentially it sounds like...
  21. Colin Legg

    Macro to store words into an array [SOLVED]

    Hi, I guess the question on my mind is why do you need to to put each row in its own array (or an array of arrays)? It would seem much more logical to use a 2 dimensional array of 3 columns and 600 rows. If you explain a bit more about where you need to go with this, we might be able to suggest...
  22. Colin Legg

    Reading excel value in VB 6.0 giving error of Invalid use of Null [SOLVED]

    It's because you have mixed data types in that column. The first 3 are strings but the last 2 are numbers. On my computer, which has XL 2007, I used: connString = "DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};IMEX=1;" & "DBQ=" & inputPath & ";" And I...
  23. Colin Legg

    Extracting part of a cell

    Hi, Here are two commonly suggested formulas: This one assumes there are two / and you want everything after the second one. It also assumes that "|@" will not occur in your data: =RIGHT(A1,LEN(A1)-SEARCH("|@",SUBSTITUTE(A1,"/","|@",2))) This one assumes that the 2nd...
  24. Colin Legg

    space to be remove in excel [SOLVED]

    Hi, PROPER() will change the first letter on each word to upper case and change all other letters to lower case. TRIM() will remove all spaces from a text string except for single spaces between words.
  25. Colin Legg

    Excel 2010 - MS Query - Error when using parameter in a subquery [SOLVED]

    Hi, I didn't know about this limitation either. I haven't tested this but, if you have permissions on the SQL Server database, you could create a View called vYourView (give it a more appropriate name) along the lines of: SELECT TransactionFile.*, UserDeptFile.UserCode FROM TransactionFile...
Back
Top