+ Reply to Thread
Results 1 to 2 of 2

Excel to notepad pasting values not in next line

  1. #1
    Registered User
    Join Date
    06-21-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    6

    Post Excel to notepad pasting values not in next line

    Hi all,

    I have one code but it works with me perfectly unfortunately the pasted values in the cell is continuous like book pad i need to paste as per excel line by line.

    Sub NOTEPAD()
    Dim str1 As String, FileToSave As String

    FileToSave = "D:\Report.txt"
    Range("A1:A500").Copy

    'Get clipboard content and assign it to str1 variable
    With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") 'Clipboard object
    On Error Resume Next
    .GetFromClipboard
    str1 = .GetText(1)
    On Error GoTo 0
    End With

    'Write to file
    If Len(str1) Then
    Open FileToSave For Output As #1
    Print #1, str1
    Close #1
    End If
    Application.CutCopyMode = False
    End Sub

    please test the code and reply positive.

    I have attached excel sheet also.

    Thanks&Regards
    Vinay Krishna
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-21-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    6

    Re: Excel to notepad pasting values not in next line

    guys waiting for your answers please answer me.

+ 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] Retaining date format when pasting to Notepad (from Excel)
    By blondeambition in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2015, 06:16 PM
  2. Copy-Pasting values into Notepad, then saving it
    By aijp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-19-2013, 02:55 PM
  3. Pasting Excel data to Notepad
    By butcher11 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-09-2013, 04:28 PM
  4. Pasting content from Excel to Notepad
    By kandanuru in forum Excel General
    Replies: 1
    Last Post: 10-31-2012, 02:35 AM
  5. pasting text from notepad not appearing in excel
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-05-2012, 04:17 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