+ Reply to Thread
Results 1 to 10 of 10

attempted modification of existing macro provides error

Hybrid View

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    94

    attempted modification of existing macro provides error

    Dear forums! I'm trying to modify the existing macro by creating new range.
    Failure, however, with this and get error 1004
    Grateful if you can spot my mistakes
    / Peter
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: attempted modification of existing macro provides error

    Hi,

    There are a few macros in there. You'll need to give us some idea which one, what you're trying to change and what you expect to happen.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    05-14-2012
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: attempted modification of existing macro provides error

    Sorry Richard, my misstake - keep forgetting that you´re not mind readers...
    the working macro is "individuell_lista"
    the bad macro is gym
    I trying to change the ranges:
    Villkor -> VillkorGym
    resultat -> resultatGym
    namn -> hall
    What I exepect is that when I run the micro "gym" then list all games in that gym

  4. #4
    Registered User
    Join Date
    05-14-2012
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: attempted modification of existing macro provides error

    Sorry Richard, my misstake - keep forgetting that you´re not mind readers...
    the working macro is "individuell_lista"
    the bad macro is gym
    I trying to change the ranges:
    Villkor -> VillkorGym
    resultat -> resultatGym
    namn -> hall
    What I exepect is that when I run the micro "gym" then list all games from the Sheet called Lista in that gym

  5. #5
    Registered User
    Join Date
    05-14-2012
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: attempted modification of existing macro provides error

    The error I get (translated from Swedish) "selection field missing or invalid field name"

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: attempted modification of existing macro provides error

    Hi,

    You are attempting to filter stuff to Range("resultat_gym"). The first row of this range A6:J6 does not have any filed names.

  7. #7
    Registered User
    Join Date
    05-14-2012
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: attempted modification of existing macro provides error

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    You are attempting to filter stuff to Range("resultat_gym"). The first row of this range A6:J6 does not have any filed names.
    Thank you for our answer Richard :-)
    The problem was not only that, but also that the range should start from column C

    Once again many thanks for your time, dedication and help. Every time I get a little better at excel macro

  8. #8
    Registered User
    Join Date
    05-14-2012
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: attempted modification of existing macro provides error

    Sorry, but I´ve one more question:
    If I don´t want to include column D, is that possible, and how?

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: attempted modification of existing macro provides error

    Hi,

    Just leave it out.

    The basic rules are
    1. Make sure there is a field column label in the first row of your source data
    2. Make sure that every field in the first row of your output data exists in the source data. You don't need to include every label only those you want.
    3. If you're using an Advanced Data Filter make sure the first cell in a row of the criteria range is a field from the source data.

    Common mistakes are blank cells in the source data first row and misspelled column label names in the output data.
    Last edited by Richard Buttrey; 05-15-2016 at 03:50 AM.

+ 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. If/then modification to existing formulas
    By qwetouvh in forum Excel General
    Replies: 1
    Last Post: 07-31-2015, 05:56 PM
  2. [SOLVED] modification & simplification of existing formula
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 03-12-2014, 08:17 AM
  3. [SOLVED] Modification to existing VBA code
    By Jed_c in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-31-2012, 06:35 PM
  4. Updates and Modification to Existing Project
    By Pherion in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-28-2009, 01:11 PM
  5. modification to existing code to If statement
    By JOUIOUI in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2006, 12:30 PM
  6. [SOLVED] Modification to existing Code
    By Jim May in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2006, 12:55 PM
  7. Move some data to new workbook - my attempted macro is no good
    By marlea in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2005, 05:50 PM

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