+ Reply to Thread
Results 1 to 2 of 2

Macro which will recognize automatically which data in the named range should be edited

  1. #1
    Registered User
    Join Date
    01-09-2016
    Location
    Poland
    MS-Off Ver
    2007
    Posts
    6

    Macro which will recognize automatically which data in the named range should be edited

    I have a quite big spreadsheet with several tabs.


    The main tab is called "ratings"
    There are several named ranges inside the "ratings" tab with same names as names of other tabs in the spreadsheet


    This is the photo of the example named range inside ratings tab called "NorTL"

    NIYl2GA.png

    Pls note the numbers outside the range (below "average" from 0 to 4), will move to them now:


    This is how tab called "NorTL" looks like

    CEgspW0.png


    So the key is, to have a macro, which will automatically "apply" values changes listed in blue cells into ratings tab.


    For example, if we take first row Stromgodset Mjondalen


    Value in column A (green column) = 3 so that means macro has to edit following cells:

    H7O6TVC.png

    Let's call column with numbers from 1 to 16 column A and the next column is column B

    Back to the tab with blue cells: first blue cells means adjustment for home team (Stromgodset) which should be applied in column A, second blue cell is adjustment for away team, again applied in column A, third blue cell is an adjustment for home team applied in column B and fourth blue cell is an adjustment for away team which should be added automatically by the macro in column B

    So for example from screenshot above, after running macro for this game, updated values should look like this:

    oMJpRe3.png

    Pls note that for this particular example values in column B are unchanged because values in 3rd and 4th blue cells = 0.00


    The biggest challenge here is:


    - how to "teach" macro to always find a correct named range inside "ratings" tab
    - how to "teach" macro to always find a correct spot inside the named range for applying value changes


    Ideally I would like the macro to run numbers update for all games (so for example, if inside the sheet NorTL, in cell B1 there is value "3", macro should run updates for all games which has number "3" added in the first column

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,973

    Re: Macro which will recognize automatically which data in the named range should be edit

    Hi and welcome to the forum

    Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Adjust existing macro to pick up specific named worksheet and copy to named range
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-08-2017, 12:03 PM
  2. [SOLVED] Automatically answer Named Conflict Dialog with No and set Named range to variable
    By mlj61289 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2013, 08:32 PM
  3. [SOLVED] How to automatically delete named range by name?
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2013, 04:02 PM
  4. [SOLVED] Worksheet_Change Macro To Hide Columns Based On A Range But Only When One Cell Is Edited
    By GEANZ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2013, 07:54 PM
  5. Automatically expand named range when new data is added
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2011, 07:43 PM
  6. Running a macro automatically when a cell is edited
    By mattsgr1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-10-2007, 06:41 AM
  7. Replies: 0
    Last Post: 07-19-2006, 01:30 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