+ Reply to Thread
Results 1 to 6 of 6

Display error message if cell has no value

  1. #1
    Registered User
    Join Date
    11-10-2015
    Location
    Derbyshire
    MS-Off Ver
    Office 2013
    Posts
    17

    Display error message if cell has no value

    Hi all hope we're all well.

    I've written a macro which is assigned to a button - when the user clicks, the file is saved as the value of what is in cell C32. This new file is saved in the same destination as the original...

    flToSave = .Path & "\" & .Worksheets("Store & Scheme Details NEW").Range("C32").Value _
    & "_" & ".xls"

    There is a formula in C32 to concatenate 5 separate cells into one name. This works perfectly when all 5 cells are filled in, however if a use misses out a box we get a '#VALUE!' error in C32. This then prompts the user of the the problematic macro and gives them the option to end or debug the macro (which I don't want them to do!!)

    Any way to simply call up an error message if all 5 cells aren't filled in? Was hoping to be able to define this message myself.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Display error message if cell has no value

    What are all that five cells?

    Or we just concentrate on C32 alone?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    11-10-2015
    Location
    Derbyshire
    MS-Off Ver
    Office 2013
    Posts
    17

    Re: Display error message if cell has no value

    Hello - we're just concentrating on C32 alone. The five cells have basic bits of data in, just text and a date.

    The formula in that cell is as follows:

    =CONCATENATE("FIELD OPERATIONS"&" "&C19&" "&C20&" "&C18&" "&F32&" "&TEXT(G32,"dd.mm.yy"))

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Display error message if cell has no value

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-10-2015
    Location
    Derbyshire
    MS-Off Ver
    Office 2013
    Posts
    17

    Re: Display error message if cell has no value

    Thanks for your reply - that looks an excellent bit of code. I do however get the variable not defined message.

    Do I need to dim 'r' as something

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Display error message if cell has no value

    Dim r as range

+ 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 display a multiple line error message?
    By athlug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2015, 03:56 AM
  2. Replies: 1
    Last Post: 06-14-2014, 09:30 AM
  3. If cell is empty and macro is pressed display error message.
    By karol2234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2012, 01:47 PM
  4. Display an error message based on particular condition
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-30-2009, 05:53 AM
  5. program to display error message
    By sivdin in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-22-2009, 01:05 PM
  6. How can I make an error message display when a required cell is left blank?
    By saulmgf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2008, 03:45 PM
  7. [SOLVED] How to display a blank cell with no error message
    By Juco in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-31-2005, 05:06 AM

Tags for this Thread

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