+ Reply to Thread
Results 1 to 2 of 2

convert month to value and whole word in vba code

  1. #1
    Forum Contributor
    Join Date
    09-09-2012
    Location
    Manila,Philippines
    MS-Off Ver
    Excel 2003
    Posts
    153

    convert month to value and whole word in vba code

    Hi,

    I have this code but I am getting a type mismatch error message:

    yr = 2014
    mth = "Mar"
    mth_value = Month(mth & 1)
    mth = Text(Date(yr,mth_value,1),"mmmm")

    I know that this is a formula in a worksheet but I need to assign this as value.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: convert month to value and whole word in vba code

    There is no Date or Text function in VBA.

    The equivalent of those worksheet functions are DateSerial and Format, though if you change the code to use those functions it will still error.

    What are you trying to do with the code?
    If posting code please use code tags, see here.

+ 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. convert word into VBA code
    By Aleemaher in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2014, 01:42 AM
  2. Request: VBA Code Convert to Word 2010
    By imshah in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2013, 07:33 AM
  3. HELP Request: VBA Code Convert to Word 2010
    By imshah in forum Word Formatting & General
    Replies: 5
    Last Post: 01-30-2013, 04:28 AM
  4. how to convert excel split code to word split code
    By gsrikanth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2012, 07:56 AM
  5. code use to convert pdf to word and excel
    By pichai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2007, 02:55 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