+ Reply to Thread
Results 1 to 5 of 5

Message Box with a formula result for hidden columns

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-27-2012
    Location
    New Brunswick, Canada
    MS-Off Ver
    Excel 2016
    Posts
    349

    Message Box with a formula result for hidden columns

    I have the following code, which has a formula in it that brings back the column name. What I would like to do is to find out which column(s) is hidden. It might just be a silly syntax error but the message box brings back the actual formula, not the result of the formula.

    Sub HiddenColumns()
    Dim i As Long
    For i = 2 To 12
    If Sheets("Comments").Columns(i).Hidden Then
    MsgBox "=CHAR(COLUMN()+64)"
    
    End If
    Next i
    
    End Sub

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

    Re: Message Box with a formula result for hidden columns

    try:-

    MsgBox =("Hidden Column " & char(i +64))
    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
    Forum Contributor
    Join Date
    05-27-2012
    Location
    New Brunswick, Canada
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Message Box with a formula result for hidden columns

    mehmetcik - I get a compile error: "Sub or Function not defined". I bolded what part of the code is highlighted

    MsgBox =("Hidden Column " & char(i +64))

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

    Re: Message Box with a formula result for hidden columns

    My mistake.

    this works:

    MsgBox "Hidden Column " & Chr(i + 64)

  5. #5
    Forum Contributor
    Join Date
    05-27-2012
    Location
    New Brunswick, Canada
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Message Box with a formula result for hidden columns

    Perfect! Thanks!

+ 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 message box alert if formula result <10
    By stephyroni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2014, 07:20 PM
  2. [SOLVED] popup message if certain criteria met in formula result
    By John Davies in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  3. popup message if certain criteria met in formula result
    By John Davies in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  4. [SOLVED] popup message if certain criteria met in formula result
    By John Davies in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  5. [SOLVED] popup message if certain criteria met in formula result
    By John Davies in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-28-2005, 06:05 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