+ Reply to Thread
Results 1 to 9 of 9

Excel cells to notepad

  1. #1
    Registered User
    Join Date
    08-29-2016
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    41

    Excel cells to notepad

    Hi

    I am not sure whether this is feasible.

    Is it possible to copy the contents in cells B2 and C2 and paste them into a notepad (.txt) automatically with A2 as the title? And the notepads can be found in the same folder as the excel sheet.

    Aries.png
    In the sample attached, there will be 4 notepads generated (Aries.txt, Taurus.txt , Gemini.txt and Cancer.txt)

    Aries.txt will have B2 and C2 contents
    Taurus.txt will have B3 and C3 contents
    Gemini.txt wil have B4 and C4 contents
    Cancer.txt will have B5 and C5 contents.

    Will appreciate if there is any macros that are able to perform the tasks.

    Thank you very much for your time and effort.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Excel cells to notepad

    Please Login or Register  to view this content.
    Edit: didn't use 'With' so removed it.
    Attached Files Attached Files
    Last edited by Neil_; 08-29-2016 at 01:46 PM.
    Frob first, tweak later

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Excel cells to notepad

    Here, try this macro:
    Please Login or Register  to view this content.
    it uses sheet 2, A column to create data because I couldn't transfer enter (chr(10)). Probably there is a way but this is workaround.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Excel cells to notepad

    Neil_ did it without helper column

  5. #5
    Registered User
    Join Date
    08-03-2015
    Location
    Earth
    MS-Off Ver
    2013
    Posts
    5

    Re: Excel cells to notepad

    Hi Neil_,

    I was just wondering if the reverse process is possible ie copy from different notepads into excel cells?

    Many Thanks

    Becon

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Excel cells to notepad

    beconajoonu,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  7. #7
    Registered User
    Join Date
    08-29-2016
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    41

    Re: Excel cells to notepad

    Hi Neil_

    The code works fine! Thank you! On a side note, if I don't want the notepads to pop up, I can just delete this code "Shell "Notepad.exe " & sFileName, vbNormalFocus" right?

    Hi zbor

    I tried your code too! It works as well! However, there are 2 line spaces between B2 and C2. Nevertheless, thank you for the code.

  8. #8
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Excel cells to notepad

    Yes, just delete the line. I only put it in as you said 'Notepad' rather than just 'text file'.

  9. #9
    Registered User
    Join Date
    08-29-2016
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    41

    Re: Excel cells to notepad

    Hi Neil_

    Noted! Thank you so much once again!

+ 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] Macro-Launch Notepad from Excel and save data in notepad and save with naming conventio
    By hjaspaul in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-01-2016, 09:19 PM
  2. [SOLVED] Save Notepad through VBA Macro, having Copied Range of Cells, Pasted into notepad
    By analystbank in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-22-2014, 02:14 AM
  3. [SOLVED] Notepad to excel and back to notepad
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2014, 10:33 AM
  4. Replies: 1
    Last Post: 01-14-2014, 04:18 PM
  5. Replies: 3
    Last Post: 08-09-2012, 04:38 PM
  6. Convert Excel cells stored as text to date and number coming from notepad
    By Fire_d in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2010, 12:34 AM
  7. Write cells from excel cells to notepad files
    By pacman76 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2010, 08:07 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