+ Reply to Thread
Results 1 to 3 of 3

Odd Type Mismatch with variables and the month function.

  1. #1
    Registered User
    Join Date
    06-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    64

    Odd Type Mismatch with variables and the month function.

    I get a type mismatch on the line where I set "second" = to the month of the next cell. This is particularly odd because the variable "First" is subject to the same method -- the only difference is that I'm using an offset inside the month function. I've checked the cells and they're all listed as "date" for their type -- not sure if that would be an issue but even if it would it shouldn't be.

    Thoughts?

    Thanks, very much.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Odd Type Mismatch with variables and the month function.

    What is in those cells?

    And change this line to this,

    Please Login or Register  to view this content.
    And why are you selecting cells? Do you have a specific reason?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Odd Type Mismatch with variables and the month function.

    Not sure about the type mismatch as I did not get it on my computer.
    But if your goal is to keep only one row per month, then your macro should be modified like this:
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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