+ Reply to Thread
Results 1 to 3 of 3

Type Mismatch Error for writing text in a cell

  1. #1
    Registered User
    Join Date
    01-25-2016
    Location
    Pennsylvania
    MS-Off Ver
    2013
    Posts
    5

    Exclamation Type Mismatch Error for writing text in a cell

    I'm writing a code that counts the number of cells with the words "no item placed" in a column. I'm also having the code count the total number of cells in the column. Then to have it calculate the percent of unplaced cells. In the end, the code should write a statement in the second row of each column that says "X unplaced cells, X %". X = count/percent. the code works until the line NumUnplaced.Value = Count + " unplaced items, " + percentUnplaced + "%" where I get a type mismatch error. I think it's because NumUnplaced is a Range and the other two our data values. Any ideas on how to fix this?

    Please Login or Register  to view this content.
    Last edited by FDibbins; 01-28-2016 at 06:45 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: Type Mismatch Error for writing text in a cell

    Please use CODE tags. As for your problem, I don't think it is a mathematical one
    Replace
    Please Login or Register  to view this content.
    with
    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 Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Type Mismatch Error for writing text in a cell

    This will format the percentage to a whole percent if that's what you want.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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] Type mismatch error obtaining value from a cell
    By ssu95bm in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-09-2015, 09:30 AM
  2. [SOLVED] type mismatch error on import of text from .txt file
    By Sayre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2014, 09:45 AM
  3. type mismatch Error when writing data to excel
    By svibuk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2013, 07:07 AM
  4. putting an if condition based on text in a cell - runtime error 13: type mismatch
    By rbs123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2013, 04:02 AM
  5. [SOLVED] "Run-time error '13': type mismatch when running macro to add text to end of text
    By nrjordan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2012, 10:34 PM
  6. Type Mismatch Error when deleting a cell
    By Josiah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2008, 01:07 PM
  7. Type Mismatch error - tried .text & .value
    By Nicole Seibert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2006, 01:45 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