+ Reply to Thread
Results 1 to 4 of 4

Macro to change 1) part of string, 2) the order of characters inside a string, 3) format

  1. #1
    Registered User
    Join Date
    04-20-2015
    Location
    Norway
    MS-Off Ver
    360
    Posts
    24

    Macro to change 1) part of string, 2) the order of characters inside a string, 3) format

    Hi all!
    I have little experience with VBA but have successfully search this forum before and found solutions to my problems. However, this time I cannot find the solutions I need, so I will be very grateful if anyone can help me!

    My overall goal is writing a macro that merges two databases that carry different information for the same companies. I have sketched out a few steps I need to complete – I’m currently stuck on step one (changing the dates).

    I’ve attached a short example of how the data is organized in the two databases, as well as how I want the result to be after I run the code.
    There are 200 000+ rows, and more rows are generated all the time – Code must include unspecified number of rows.

    Macro I want:
    1)
    In sheet Data1 (column G) – Change string and format:
    Because of the language I’m running I need to change “May”, “Oct”, and “Dec” to “Mai”, “Okt”, and “Des” and have the format changed to date.
    The macro I’m using changes the words but not the format.

    2)
    In sheet Data2 (column B) – Change string and format:
    Change the string from YYYYMMDD to DD.MM.YYYY and format as date.
    I have no clue on how to manipulate the string like this.
    The result must be in the way that others can paste data from the two databases (Data1 and Data2) into the respective worksheets and then run the macro.

    The macro I'm using:
    Please Login or Register  to view this content.
    Any help is greatly appreciated!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Macro to change 1) part of string, 2) the order of characters inside a string, 3) form

    Try this...

    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.

  3. #3
    Registered User
    Join Date
    04-20-2015
    Location
    Norway
    MS-Off Ver
    360
    Posts
    24

    Re: Macro to change 1) part of string, 2) the order of characters inside a string, 3) form

    Thank you, AlphaFrog!
    I think this does it. Unfortunately, I don't have access to the full file during the weekend. So unless I've overlooked something I'll mark this as thread as solved after I've tested it on Monday

    I really appreciate your help! You are awesome

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Macro to change 1) part of string, 2) the order of characters inside a string, 3) form

    You're welcome. Thanks for the feedback.

+ 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] How can I assign the last 4 characters of a string to a string variable?
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2015, 01:41 AM
  2. change part of a string in the file name and cut paste
    By choupi_nette in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-27-2015, 08:38 AM
  3. [SOLVED] How Do I Find and Return a String When Only Part of that String is Known?
    By Foamy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-08-2014, 05:31 AM
  4. [SOLVED] Macro to create a new line within a text string if specific characters appear mid-string
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2014, 11:32 AM
  5. [SOLVED] Find a string by VBA Regular Expression and replace a part of that string
    By taps in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-25-2013, 11:08 AM
  6. rearranging order of text string inside a cell
    By Milan Limbachia in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-19-2012, 05:01 PM
  7. Replies: 0
    Last Post: 08-29-2005, 11:03 AM

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