+ Reply to Thread
Results 1 to 9 of 9

select cell + moving up.

  1. #1
    Registered User
    Join Date
    11-21-2015
    Location
    france
    MS-Off Ver
    2010
    Posts
    57

    select cell + moving up.

    Hi everyone,

    I am stuck at progressing on my macro.
    2 tabs on my spreadsheet "Analys" + "Data"

    The macro below allows me to find the Max value in a list of data.
    I would need now to associate this "Max" value to the title of the column that contains this Max value.

    So basically the macro would select the max value, then would go up to pick the name of the column.

    Thank you in advance. Hope it makes sense.



    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: select cell + moving up.

    you know the rownumber of Columnheaders so

    Please Login or Register  to view this content.
    cheers
    Leo

  3. #3
    Registered User
    Join Date
    11-21-2015
    Location
    france
    MS-Off Ver
    2010
    Posts
    57

    Re: select cell + moving up.

    Thanks Leo for your feedback.

    However I am not searching to have a msgbox. I basically want to have my MAX value selected.

    Thanks a lot for your help.

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: select cell + moving up.

    i read this

    then would go up to pick the name of the column.

    you can change the msgbox to any sheet and range you want

    cheers
    Leo

  5. #5
    Registered User
    Join Date
    11-21-2015
    Location
    france
    MS-Off Ver
    2010
    Posts
    57

    Re: select cell + moving up.

    Ok got you.

    However here, it is giving me the name of first column in my range - my max is not necessary in the first column..

    I would like this basically :

    Please Login or Register  to view this content.
    But not working. I m searching here the column number of my MAX value.
    Thanks
    Last edited by ced0802; 10-21-2016 at 06:01 AM.

  6. #6
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: select cell + moving up.

    Maybe something wrong with your loop, witch you dont need

    try like this, change the red items, range to real range with values, and real row number with column headers

    Please Login or Register  to view this content.
    Cheers
    Leo

  7. #7
    Registered User
    Join Date
    11-21-2015
    Location
    france
    MS-Off Ver
    2010
    Posts
    57

    Re: select cell + moving up.

    Thanks again Leo,

    I get the following error on "myheader" line :

    "Run time error 91.
    Object variable or with block variable not set"

  8. #8
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: select cell + moving up.

    Please Login or Register  to view this content.
    this must do it

    Cheers
    Leo

  9. #9
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: select cell + moving up.

    made a file with the sheetnames and this code

    Please Login or Register  to view this content.

    kind regards
    Leo
    Attached Files Attached Files

+ 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. Need VBA to select and reassign moving XY chart data
    By Thisguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2012, 08:19 AM
  2. Replies: 0
    Last Post: 05-21-2012, 06:59 AM
  3. Moving select worksheets from multiple file to one workbook
    By jkolstoe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2011, 07:41 PM
  4. Copying moving range based on moving cell reff.
    By Varmark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2011, 04:47 AM
  5. Replies: 1
    Last Post: 05-01-2007, 06:18 PM
  6. Need to Select/Format/Sum 2 moving Columns
    By Chaser in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2007, 11:27 AM
  7. Moving cursor to select input field in forms
    By ChucklesAS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2007, 03:18 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