+ Reply to Thread
Results 1 to 8 of 8

Macro that looks for a value in a column and displays the results in a message box

  1. #1
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Macro that looks for a value in a column and displays the results in a message box

    I would like a macro that looks for the value "ERROR" in column AX and then display the values from column A one row above the row with the "ERROR" value in AX into one message box.
    Can this be done, or is there a more efficient way of doing this?

    Thank you
    Last edited by pasqualebaldi; 01-28-2016 at 12:44 PM.

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Macro that looks for a value in a column and displays the results in a message box

    try this way:
    Please Login or Register  to view this content.
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Macro that looks for a value in a column and displays the results in a message box

    Quote Originally Posted by bulina2k View Post
    try this way:
    Please Login or Register  to view this content.
    When I try to run this, I get "Run-time error '1004': Method 'Range' of Object'_Worksheet' failed"

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Macro that looks for a value in a column and displays the results in a message box

    To return multiple errors.


    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  5. #5
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861
    Quote Originally Posted by pasqualebaldi View Post
    When I try to run this, I get "Run-time error '1004': Method 'Range' of Object'_Worksheet' failed"
    I.m sorry. I missed .row
    For Each cel In Range("AX2:AX" & Cells(Rows.Count, "AX").End(xlUp).row)

  6. #6
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Macro that looks for a value in a column and displays the results in a message box

    Quote Originally Posted by mehmetcik View Post
    To return multiple errors.


    Please Login or Register  to view this content.
    Thank you! Can this be modified to display 1 row up like it is doing now, but instead displaying the value in column AX, can the message display the value in column A?

    For example: AX10="ERROR" so the message box displays A9 value

    Thanks!

  7. #7
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Macro that looks for a value in a column and displays the results in a message box

    Quote Originally Posted by pasqualebaldi View Post
    Thank you! Can this be modified to display 1 row up like it is doing now, but instead displaying the value in column AX, can the message display the value in column A?

    For example: AX10="ERROR" so the message box displays A9 value

    Thanks!
    I see where I needed to modify the offset. Thank you very much for all of your help. I really appreciate it!

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Macro that looks for a value in a column and displays the results in a message box

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 01-28-2016 at 02:09 PM. Reason: DeBugged

+ 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] Formula copies down the column but displays results from the cell it was copied from
    By debbimac11 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-30-2014, 03:03 PM
  2. Column Search That Displays Results in another Column
    By b0ttle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-30-2014, 06:59 PM
  3. [SOLVED] Using a Message Box to Summarize Macro Results
    By Student1990 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2013, 07:27 AM
  4. Need macro that calculates two formula but displays only one of them in column
    By jro4 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2013, 11:32 AM
  5. [SOLVED] Display find macro results in message box?
    By ANDREWA in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2012, 06:50 PM
  6. Replies: 2
    Last Post: 02-03-2012, 12:13 PM
  7. Need a message box that displays loading time.
    By havocdragon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2005, 02:06 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