+ Reply to Thread
Results 1 to 3 of 3

macro that exports text to notepad and also removes consecutive exclamation points...

  1. #1
    Registered User
    Join Date
    08-04-2009
    Location
    wisconsin
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question macro that exports text to notepad and also removes consecutive exclamation points...

    I was wondering if anyone can help me create a macro that exports text to notepad and also removes any consecutive exclamation points. I am creating a configuration generator for different networking equipment and depending on what is selected in other rows I could have quite a few exclamation points in a row that I would like taken out and turned into only 1 exclamation point when these cells are copied and pasted into notepad. Is this do-able? I am new to using macros and I tried the macro creator but it just always deleted the same row as I did when I recorded the macro. I just need it when it sees "exclamation 'enter' exclamation" it should turn it into just exclamation until there is only a single exclamation point in-between lines of code instead of multiple lines of exclamation points. I am currently running the below macro.

    Sub AddConnectionTOexisting()
    'The range that contains the values
    Range("A1:A33").Copy
    'Start Notepad And let it recieve focus
    Shell "notepad.exe", vbNormalFocus
    'Send the keys CTRL+V To Notepad (i.e the window that has focus)
    SendKeys "^V"
    End Sub

    Sample of what my problem looks like when pasted to notepad:
    mode t1
    clock adaptive
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    apply configuration
    exit


    If anyone has any ideas on how this could be done I would really appreciate it. Thanks.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: macro that exports text to notepad and also removes consecutive exclamation point

    Try this

    Please Login or Register  to view this content.
    Martin

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: macro that exports text to notepad and also removes consecutive exclamation point

    Welcome to the forum, indullg83.

    Please take a few minutes to read teh forum rules, and then edit your post to add code tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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