+ Reply to Thread
Results 1 to 14 of 14

Display none-empty cells in msgbox

  1. #1
    Forum Contributor Axmed.cm's Avatar
    Join Date
    02-05-2015
    Location
    Somalia
    MS-Off Ver
    2013
    Posts
    231

    Display none-empty cells in msgbox

    Hi all

    I have a list of names in cells A1:A11

    Cells A3,A4,A7 and A9 are blank.

    So can i have a code to display a list of non-empty cells only in a msgbox?

    Thanks
    Ahmedka
    GUURE

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

    Re: Display none-empty cells in msgbox

    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.

  3. #3
    Registered User
    Join Date
    11-19-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    2016
    Posts
    57

    Re: Display none-empty cells in msgbox

    or:

    Sub macro1()

    Dim msg As String

    For x = 1 To 11
    If Not Cells(x, 1) = "" Then msg = msg & vbNewLine & Cells(x, 1)
    Next x

    MsgBox msg
    End Sub

  4. #4
    Forum Contributor Axmed.cm's Avatar
    Join Date
    02-05-2015
    Location
    Somalia
    MS-Off Ver
    2013
    Posts
    231

    SOLVED: Display none-empty cells in msgbox

    Thank you my brothers mehmetcik and dOOb..
    it is well functioning. Especially the one from dOOb. I used it.
    Last edited by Axmed.cm; 03-20-2016 at 08:18 AM. Reason: SOLVED

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,554

    Re: Display none-empty cells in msgbox

    This should do...
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor Axmed.cm's Avatar
    Join Date
    02-05-2015
    Location
    Somalia
    MS-Off Ver
    2013
    Posts
    231

    Re: Display none-empty cells in msgbox

    Thanks dear
    that very helpful
    is it possible to have a serial number for each line in the msgbox?
    eg.*
    1. Ahmed
    2. Yasser
    3. Khail

    Thanks more

  7. #7
    Registered User
    Join Date
    11-19-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    2016
    Posts
    57

    Re: Display none-empty cells in msgbox

    assuming you are still using my solution, just edit this line
    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,554

    Re: Display none-empty cells in msgbox

    Quote Originally Posted by Axmed.cm View Post
    is it possible to have a serial number for each line in the msgbox?
    eg.*
    1. Ahmed
    2. Yasser
    3. Khail
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor Axmed.cm's Avatar
    Join Date
    02-05-2015
    Location
    Somalia
    MS-Off Ver
    2013
    Posts
    231

    Re: Display none-empty cells in msgbox

    dear dOOb and jindon
    Thank you for your quick response
    this writes the row number of the cell.
    I need a serial number like 1 2 3
    Thanks dear

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Display none-empty cells in msgbox

    I think the solutions provided are excellent
    But try this
    Please Login or Register  to view this content.
    Last edited by YasserKhalil; 03-25-2016 at 03:39 PM.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  11. #11
    Forum Contributor Axmed.cm's Avatar
    Join Date
    02-05-2015
    Location
    Somalia
    MS-Off Ver
    2013
    Posts
    231

    Re: Display none-empty cells in msgbox

    Thanks my brother khalil
    for example
    A1=Yasser
    A2=""
    A3=Khalil
    then msgbox reads:
    1. Yasser
    3. Khalil
    this means it reads row numbers and names
    but I need msgbix to appear like this:
    1. Yasser
    2. Khalil
    thanks my dear

  12. #12
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Display none-empty cells in msgbox

    I have edited post #10 .. try it now

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,554

    Re: Display none-empty cells in msgbox

    Quote Originally Posted by Axmed.cm View Post
    dear dOOb and jindon
    Thank you for your quick response
    this writes the row number of the cell.
    I need a serial number like 1 2 3
    Thanks dear
    Have you really tried mine?
    Attached Files Attached Files

  14. #14
    Forum Contributor Axmed.cm's Avatar
    Join Date
    02-05-2015
    Location
    Somalia
    MS-Off Ver
    2013
    Posts
    231

    [SOLVED] Display none-empty cells in msgbox

    Thank you all my dear friends.
    it is SOLVED.
    Have a good day..

    @jindon, I was tried yours first but I think something went wrong in my side. it was already OK.

+ 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. If > 7 cells are true in a range then display msgbox
    By Templemind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2014, 09:02 AM
  2. Display msgbox if two cells in range are not empty
    By loroverde in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2014, 12:49 AM
  3. Display N/A in empty cells
    By Snoopy2003 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2013, 12:41 AM
  4. highlit duplicated cells and display the row number and cell value in msgbox
    By kmakjop in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-07-2013, 04:26 PM
  5. Replies: 5
    Last Post: 07-05-2012, 07:09 AM
  6. MsgBox to display Cells and verify/update
    By Ron1121 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2010, 01:51 AM
  7. Display empty cells
    By botany_girl in forum Excel General
    Replies: 1
    Last Post: 07-19-2005, 01:05 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