+ Reply to Thread
Results 1 to 6 of 6

Stop Automatic Cell formatting to a date.

  1. #1
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Stop Automatic Cell formatting to a date.

    Hello everyone,

    I have a Macros that auto populates a list of files.
    This is a typical files name : 2-3 , Sections - Cell #7 Earthwork , Landfill , ACI , 7777-030.1 , 1989 , 2
    Once the list of files is in excel, I perform a text to column Macro, here is the code :

    Please Login or Register  to view this content.
    The delimiter is the Comma, and the first column of my table, witch is supposed to be sheet # and show as 2-1, 2-2.... keep coming up as a dates.

    This is what its giving me :
    COMMADATEPROB.PNG

    I have tried formatting all the cells beforehand, even only the cells in the column, but every single time i run the Macro, the cells I formatted at Text keeps changing to a Date/General format every time i run the Macro. This is extremely frustrating.

    All the files are already named, so i would really like to be able to write something in my code the would stop the automatic formatting of the destination cells. Putting ' in front of the text would be extremely time consuming as there are a big number of files.

    Thanks

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Stop Automatic Cell formatting to a date.

    I'll qualify my answer by saying that I'm not a VBA expert, so I can't guarantee this will work...

    Try changing Array(1, 1) to Array(1, 2), which as far as I can tell should set the type to text.

    You can set the different column types individually as well, I think, from looking at what I got when I did some macro recording. It looks like this would set the first column to text (1, 2) and the rest to general (#, 1):
    Please Login or Register  to view this content.
    Hope that helps.
    Last edited by Aardigspook; 07-10-2017 at 04:03 PM. Reason: Change fonts/colours to clarify
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

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

    Re: Stop Automatic Cell formatting to a date.

    How is the data being populated in the first place?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Re: Stop Automatic Cell formatting to a date.

    Thank you Spook, i'm going try it out!

    And here is a piece of code i found to auto populate:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Re: Stop Automatic Cell formatting to a date.

    It Worked Spook, Thanks alot!!!

  6. #6
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Stop Automatic Cell formatting to a date.

    You're welcome, glad I could help - thanks for the rep and for marking the thread as Solved.

+ 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. Stop automatic date formatting (Excel 2002)
    By lesoies in forum Excel General
    Replies: 1
    Last Post: 12-17-2012, 11:41 PM
  2. [SOLVED] How do I stop automatic 'date' mode?
    By Gabrielle in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-01-2012, 04:14 AM
  3. Replies: 2
    Last Post: 04-26-2012, 02:47 PM
  4. STOP automatic cell formatting
    By justinb2 in forum Excel General
    Replies: 6
    Last Post: 08-02-2011, 12:14 AM
  5. Excel 2007 : Formatting automatic date
    By gadgetgurl in forum Excel General
    Replies: 2
    Last Post: 05-28-2010, 01:18 AM
  6. [SOLVED] import /paste -stop automatic conversion of text 05-12345 to date
    By artech in forum Excel General
    Replies: 1
    Last Post: 08-20-2006, 04:15 PM
  7. Automatic date formatting
    By Vidz in forum Excel General
    Replies: 3
    Last Post: 10-27-2005, 07:05 AM
  8. Stop Automatic Date Conversion
    By Jerry Baker in forum Excel General
    Replies: 1
    Last Post: 10-13-2005, 07:05 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