+ Reply to Thread
Results 1 to 5 of 5

macro to record value "1" depending on another cell value being highest in range

  1. #1
    Forum Contributor
    Join Date
    11-14-2014
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    100

    macro to record value "1" depending on another cell value being highest in range

    I'm trying to use this code to place a "1" in cell AD18 if value of cell AD16 is highest in range X16:AO16if not highest then "0"



    Please Login or Register  to view this content.
    Last edited by alansidman; 10-18-2015 at 05:11 PM. Reason: code tags added

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

    Re: macro to record value "1" depending on another cell value being highest in range

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    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

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

    Re: macro to record value "1" depending on another cell value being highest in range

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    11-14-2014
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    100

    Re: macro to record value "1" depending on another cell value being highest in range

    thanks
    I placed that code in to my existing code but i get an error at the bottom where my code say's "Else do Events"
    the error says "compile error Else without If"



    Please Login or Register  to view this content.

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

    Re: macro to record value "1" depending on another cell value being highest in range

    You are missing an End With command and VBA gets confused.

+ 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. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. [SOLVED] Ask user if they would like to spell check range A3:L3 when "Add Record" Macro is used.
    By Dremzy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2014, 10:22 AM
  3. [SOLVED] Find "LOGGED IN" person and record their "LOG OUT" time next to them
    By TruBeast in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 03-07-2013, 05:46 PM
  4. Help with Macro: Using "record", how to select a dynamic range of cells
    By Stalinski in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2012, 06:04 PM
  5. Macro Error with code "Range("A65536").End(xlUp).EntireRow.Insert"
    By lukasj13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2010, 08:48 PM
  6. "Turn "record macro" display on.
    By greaseman in forum Excel General
    Replies: 2
    Last Post: 04-28-2006, 12:58 PM
  7. Macro that runs entered value through "low" and "high" range
    By Vika.F in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2005, 03:35 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