+ Reply to Thread
Results 1 to 36 of 36

Formula in a macro doesnt work for Spanish Excel user

Hybrid View

  1. #1
    Registered User
    Join Date
    01-03-2013
    Location
    Indiana, US
    MS-Off Ver
    Microsoft 365
    Posts
    26

    Re: Formula in a macro doesnt work for Spanish Excel user

    Keebellah: DV = DateValue(DayNum & " " & Mnth & " " & Yr) is the line of code that is making the macro error.

  2. #2
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: Formula in a macro doesnt work for Spanish Excel user

    =DATEVALUE(MID(D1,FIND("\",D1)+1,FIND(" ",D1)-FIND("\",D1)-3) &" " & MID(D1,FIND(" ",D1)+1,15)&MID(D1,FIND("\",D1)-4,4))
    Will always return VALUE error in any system other than English.

    The problem is the system locale, it's in Spanish, and you're parsing a month string "October", which has no meaning and can't be translated into a proper month number, as the string for Month 10 is "Octubre" in Spanish.

    SYSTEMLOCALE = Application.LanguageSettings.LanguageID(msoLanguageIDUI)
    Spanish locale is 1033, so you could do a:
    IF SYSTEMLOCALE = 1033
    CHANGE MONTH STRINGS FROM ENGLISH TO SPANISH: Enero, Febrero, Marzo... an so on

    Hope that helps a little.

+ 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. Macro which used to work, now doesnt -
    By Spyros13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2016, 02:08 PM
  2. Macro copy doesnt work right
    By vindalloo77 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2016, 08:34 AM
  3. Excel macro vba - hide specific colums doesnt work due to merged cell
    By kilaz17 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2012, 11:24 AM
  4. My loop macro doesnt work
    By matdog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2010, 02:32 AM
  5. [SOLVED] macro from excel 97 that doesnt work in excel 2003 (help)
    By thanhhuy27@gmail.com in forum Excel General
    Replies: 2
    Last Post: 05-16-2006, 10:10 AM
  6. some functions doesnt work in macro?
    By ExcelPower in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2006, 03:40 AM
  7. [SOLVED] Please help : Macro doesnt work on other PCs
    By Jason in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2005, 05:55 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