+ Reply to Thread
Results 1 to 6 of 6

Macro works in 2010&2013 but not Excel 2003

Hybrid View

Mattiac Macro works in 2010&2013 but... 02-08-2014, 02:35 PM
Mattiac Re: Excel 2003 macro problems 02-08-2014, 02:57 PM
Fotis1991 Re: Macro works in 2010&2013... 02-08-2014, 03:14 PM
Mattiac Re: Macro works in 2010&2013... 02-08-2014, 05:23 PM
Mattiac Re: Macro works in 2010&2013... 03-05-2014, 08:16 PM
Fotis1991 Re: Macro works in 2010&2013... 03-06-2014, 03:12 AM
  1. #1
    Registered User
    Join Date
    02-01-2013
    Location
    Sverige
    MS-Off Ver
    Excel 2003
    Posts
    13

    Arrow Macro works in 2010&2013 but not Excel 2003

    This macro works for Excel 2010 and 2013, but not
    Excel 2003. When I run it in Excel 2003 all the cells
    (up to row 456) gets filled with #NAMN?
    I'm trying to import data from the file called laget.xls
    to idrott.xls where the macro resides. I'm using the
    Swedish version of Excel 2003 so I guess NAMN
    means NAME in English.


    Sub button_import()
    '
    ' button_import Macro
    ' imports data from laget.xls
    '
    ' Keyboard Shortcut: Ctrl+Shift+I
    '
    
        Range("P2").Select
        Selection.End(xlToLeft).Select
        Range("A2:T506").Select
        Selection.ClearContents
        Range("A2").Select
    
        ActiveWindow.ScrollColumn = 6
        ActiveWindow.ScrollColumn = 5
        ActiveWindow.ScrollColumn = 4
        ActiveWindow.ScrollColumn = 1
        Range("A2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(LEFT('[laget.xls]Sida 1'!RC,FIND("" "",'[laget.xls]Sida 1'!RC,1)),"""")"
        Range("C2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(MID('[laget.xls]Sida 1'!RC[-2],FIND("" "",'[laget.xls]Sida 1'!RC[-2],1),(LEN('[laget.xls]Sida 1'!RC[-2])-FIND("" "",'[laget.xls]Sida 1'!RC[-2],1))+1),"""")"
        Range("D2").Select
        ActiveCell.FormulaR1C1 = _
            "=IF(RC[-3]="""","""",IF(MOD(MID('[laget.xls]Sida 1'!RC[-1],LEN('[laget.xls]Sida 1'!RC[-1])-1,1),2)=0,""Kvinna"",""Man""))"
        Range("F2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(IF('[laget.xls]Sida 1'!RC[-3]=0,"""",'[laget.xls]Sida 1'!RC[-3]),"""")"
        Range("H2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(IF('[laget.xls]Sida 1'!RC=0,"""",'[laget.xls]Sida 1'!RC),"""")"
        Range("I2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(IF('[laget.xls]Sida 1'!RC=0,"""",'[laget.xls]Sida 1'!RC),"""")"
        Range("J2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(IF('[laget.xls]Sida 1'!RC=0,"""",'[laget.xls]Sida 1'!RC),"""")"
        Range("K2").Select
        ActiveCell.FormulaR1C1 = "=IF(RC[-10]="""","""",""Sverige"")"
        Range("L2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(IF('[laget.xls]Sida 1'!RC[-7]=0,"""",'[laget.xls]Sida 1'!RC[-7]),"""")"
        Range("M2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(IF('[laget.xls]Sida 1'!RC[-7]=0,"""",'[laget.xls]Sida 1'!RC[-7]),"""")"
        Range("N2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(IF('[laget.xls]Sida 1'!RC[-7]=0,"""",'[laget.xls]Sida 1'!RC[-7]),"""")"
        Range("P2").Select
        ActiveCell.FormulaR1C1 = _
            "=IFERROR(IF('[laget.xls]Sida 1'!RC[-12]=0,"""",'[laget.xls]Sida 1'!RC[-12]),"""")"
        Range("Q3").Select
        Selection.End(xlToLeft).Select
        Selection.End(xlToLeft).Select
        Range("A2:T456").Select
        Selection.FillDown
        ActiveWindow.ScrollRow = 429
        ActiveWindow.ScrollRow = 422
        ActiveWindow.ScrollRow = 402
        ActiveWindow.ScrollRow = 357
        ActiveWindow.ScrollRow = 355
        ActiveWindow.ScrollRow = 352
        ActiveWindow.ScrollRow = 341
        ActiveWindow.ScrollRow = 201
        ActiveWindow.ScrollRow = 194
        ActiveWindow.ScrollRow = 192
        ActiveWindow.ScrollRow = 191
        ActiveWindow.ScrollRow = 88
        ActiveWindow.ScrollRow = 42
        ActiveWindow.ScrollRow = 31
        ActiveWindow.ScrollRow = 18
        ActiveWindow.ScrollRow = 10
        ActiveWindow.ScrollRow = 2
        ActiveWindow.ScrollRow = 1
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Application.CutCopyMode = False
        Range("A2").Select
    End Sub
    Last edited by Mattiac; 02-08-2014 at 03:00 PM.

  2. #2
    Registered User
    Join Date
    02-01-2013
    Location
    Sverige
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Excel 2003 macro problems

    Thank you.
    Last edited by Mattiac; 02-08-2014 at 03:00 PM.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro works in 2010&2013 but not Excel 2003

    Your recorded macro use the function IFERROR which works in Excel > 2003. You can use the IF(ISERROR fuvctions which works in all the Excel Editions.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    02-01-2013
    Location
    Sverige
    MS-Off Ver
    Excel 2003
    Posts
    13

    Thumbs up Re: Macro works in 2010&2013 but not Excel 2003

    Quote Originally Posted by Fotis1991 View Post
    Your recorded macro use the function IFERROR which works in Excel > 2003. You can use the IF(ISERROR fuvctions which works in all the Excel Editions.
    Thank you so much for your quick and helpful answer, Fotis! :D
    It solved the problem! I wish you a great weekend!

    I'm now going to look for the setting so I can mark
    this thread as solved.

  5. #5
    Registered User
    Join Date
    02-01-2013
    Location
    Sverige
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Macro works in 2010&2013 but not Excel 2003

    PS. I just recently found about stars here so I
    gave you a star of course! Better late than
    never. Thank you very much again! :-)

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro works in 2010&2013 but not Excel 2003

    ..........................................

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Problems when using macro created in Excel 2000, in Excel 2003
    By Vlada in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2006, 11:24 AM
  2. Memory problems in Excel 2003
    By Richard in forum Excel General
    Replies: 4
    Last Post: 10-19-2005, 09:05 PM
  3. Excel 2003 performance problems
    By bjarvis in forum Excel General
    Replies: 0
    Last Post: 09-28-2005, 03:27 PM
  4. [SOLVED] Excel 2003 vs 2002 problems
    By Mike in forum Excel General
    Replies: 0
    Last Post: 05-27-2005, 11:05 AM
  5. Problems in Excel 2003
    By Marc (NL) in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2005, 08: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