Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Dec 2001
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CopyPaste to Notepad (Win98 Excel 2000)

    How do I write a macro to copy range A1:A2 from Excel Sheet 1 Filename A.xls, open Notepad and Paste. To me it is a bit tricky because I am only a novice in VBA and know nothing of working across Windows Applications. Appreciate script with syntax. Thank you.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CopyPaste to Notepad (Win98 Excel 2000)

    Like this:

    Sub test()
    Dim retval As Variant
    ActiveWorkbook.Worksheets("sheet1").[a1:a2].Copy
    Application.WindowState = xlMinimized
    retval = Shell("c:windowsnotepad.exe", vbMaximizedFocus)
    Application.Wait Now + TimeValue("00:00:01")
    AppActivate retval
    SendKeys "^v"
    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Lounger
    Join Date
    Dec 2001
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CopyPaste to Notepad (Win98 Excel 2000)

    Excellent solution. Thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •