Results 1 to 15 of 15

Macro which work with Excel 365, but not for 2006 Professional

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    174

    Macro which work with Excel 365, but not for 2006 Professional

    Hi friends,

    I have this code (purpose of formula there is to extract some amounts from column B (highlighted by yellow in attached file) and put them in valid number format into column D (highlighted by green in attached file).

    Problem is that code works perfectly for me on Excel 365, but if I send it to my colleagues which majority of them are on 2016 professional, it shows them Run-time error '1004': Application-defined or object-defined error.

    Could you pls help me to fix it and if possible to make this code applicable for different versions of Excel?

    Sub extract_amount()
    
    Dim lw As Long
    lw = Cells(14, 1).End(xlDown).Row 'range till blank row
    
    'extract amount from column B
    Range("D16").Formula = "=NPV(-0.9,IFERROR(--MID(B16,LEN(B16)-ROW(INDIRECT(""1:""&LEN(B16)))+1,1)/10,""""))/CHOOSE(ISNUMBER(FIND("" - "",B16))+1,100,-100)*-1"
    Range("D16:D" & lw).FillDown
               
    'formula above added "@" which I need to remove it in this next step to see valid result
        Cells.Replace What:="@", Replacement:="", LookAt:=xlPart, SearchOrder:= _
            xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False, _
            FormulaVersion:=xlReplaceFormula2
    End Sub
    Thank you in advance and have a great day
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 01-31-2016, 07:46 AM
  2. Professional Excel Help
    By mlbdc2012 in forum Excel General
    Replies: 1
    Last Post: 10-05-2015, 03:30 PM
  3. [SOLVED] Professional Excel Development
    By E.Q. in forum Excel General
    Replies: 1
    Last Post: 08-16-2006, 11:45 PM
  4. [SOLVED] How do I insert a 2006 calendar into a work sheet?
    By C D in forum Excel General
    Replies: 1
    Last Post: 07-11-2006, 11:25 PM
  5. Replies: 2
    Last Post: 03-15-2006, 05:23 PM
  6. [SOLVED] excel professional
    By bcascio in forum Excel General
    Replies: 1
    Last Post: 02-11-2006, 03:10 PM
  7. ms office professional 2003 - Excel
    By frustrated in forum Excel General
    Replies: 2
    Last Post: 03-02-2005, 07:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1