Results 1 to 4 of 4

Thread: How to copy code ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Ruinen, Drente, Netherlands
    Posts
    192

    How to copy code ?

    How to copy code ? In some threads there is code with numbers; I can't copy these code...

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: How to copy code ?

    It was discussed about it here:
    http://www.vbforums.com/showthread.php?t=484830

    And questions like this, should be asked in the Forum Feedback

  3. #3
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: How to copy code ?

    If you mean there are numbers or "#" symbols between each line then here's what I do,
    Copy the code as you normally would, then call this in one of your programs or make a program just for this pupose.

    Code:
    Private Sub mnuFixCode_Click()
        
        Dim myarr() As String
        Dim i As Integer
        
        myarr = Split(Clipboard.GetText, vbNewLine)
        
        For i = UBound(myarr) To 0 Step -1
            If IsNumeric(myarr(i)) Then
                myarr(i) = ""
            ElseIf (myarr(i)) = "#" Then
                myarr(i) = ""
            End If
        Next i
          
          Clipboard.Clear
          Clipboard.SetText Replace(Join(myarr, vbNewLine), vbLf & vbCr, "")
    
    End Sub
    Now paste to VB as you normally would.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to copy code ?

    Moved to Forum Feedback

Posting Permissions

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



Click Here to Expand Forum to Full Width