Forum Discussion

JimK's avatar
JimK
Copper Contributor
Feb 13, 2025
Solved

Import Tab Delimited File from Clipboard

I'm looking to create a macro in excel to import a file from clipboard.  I have tried to record a macro and that did not work.  I do not want to enter a file name.  I would like to copy from notepad and execute macro to import the data with pipe delimits.

 

Sorry if this is a repeat, I ould not fine an answr anywhere.

Thanks.

  • See the attached workbook.

    The Clipboard data is retrieved using Windows API calls.  The parsing/splitting of the text is done using VBA's Split function.  (The code is written for readability, not highest performance.)

4 Replies

  • SnowMan55's avatar
    SnowMan55
    Bronze Contributor

    See the attached workbook.

    The Clipboard data is retrieved using Windows API calls.  The parsing/splitting of the text is done using VBA's Split function.  (The code is written for readability, not highest performance.)

Resources