+ Reply to Thread
Results 1 to 6 of 6

VBA code to return Cell address

  1. #1
    Registered User
    Join Date
    04-28-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    81

    VBA code to return Cell address

    Hi

    I have data in a column. I want a VBA code that finds out the maximum vaklue in the range and returns the address of that cell.

    Thank You so much in Advance

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: VBA code to return Cell address

    Look at this MS Link

    http://support.microsoft.com/kb/139574/EN-US
    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 Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi, try this function !


    PHP Code: 
    Function AddressMax$(Rg As Range)
           
    Dim Rm As Range
                V 
    Application.Max(Rg)
           
    Set Rm Rg.Find(V)
        If 
    Not Rm Is Nothing Then AddressMax Rm.Address(00) & " : " VSet Rm Nothing
    End 
    Function 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  4. #4
    Registered User
    Join Date
    04-28-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Hi, try this function !

    Hi, I have got the max value but still unable to retrieve the cell address. For simplicity sake, please use A1: A100 as the range. I want the code within the subroutine and not use a function. Please advice.

  5. #5
    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: Hi, try this function !

    Hi,

    Perhaps

    Please Login or Register  to view this content.
    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.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: VBA code to return Cell address

    Taking richard's code one step further

    Please Login or Register  to view this content.

+ 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] How to return address of the column or cell I select, not just return the value?
    By qzqzjcjp in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-18-2014, 04:57 PM
  2. return the cell address
    By Jymoz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-12-2012, 08:28 AM
  3. Replies: 1
    Last Post: 03-08-2012, 01:57 PM
  4. Replies: 3
    Last Post: 07-27-2011, 02:29 PM
  5. [SOLVED] return a cell address?
    By green fox in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-20-2005, 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