Results 1 to 4 of 4

Copy and Paste without special characters

Threaded View

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Copy and Paste without special characters

    Hi.
    I'd like to see if there is a way to emplementar this code (follows) that you copy and paste, put this in the spreadsheet that he just copies and pastes, colasse need that when the values ​​of columns such date, were without '/', '.', '-', it would be possible?

    Sub Copy()
    ActiveWorkbook.Sheets("After").Activate
    Range("A1").Activate
        Dim i, UltimaLinha, LinhaPlan2 As Integer
        
        UltimaLinha = Sheets("Befor").Cells(Cells.Rows.Count, 1).End(xlUp).Row
        If UltimaLinha < 2 Then UltimaLinha = 2
        
        LinhaPlan2 = 2
        Application.ScreenUpdating = False
        
        For i = 2 To UltimaLinha
            If Sheets("Befor").Range("A" & i).Value <> "" Then
            
                Sheets("After").Range("A" & LinhaPlan2).Value = Sheets("Befor").Range("A" & i).Value
                Sheets("After").Range("B" & LinhaPlan2).Value = Sheets("Befor").Range("B" & i).Value
                Sheets("After").Range("C" & LinhaPlan2).Value = Sheets("Befor").Range("C" & i).Value
                Sheets("After").Range("D" & LinhaPlan2).Value = Sheets("Befor").Range("D" & i).Value
                LinhaPlan2 = LinhaPlan2 + 1
        
     
            End If
        Next
        
        Application.ScreenUpdating = True
        ActiveWorkbook.Sheets("After").Activate
    Range("A1").Activate
    End Sub
    Attached Files Attached Files
    Last edited by marreco; 07-02-2012 at 07:33 AM.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

Thread Information

Users Browsing this Thread

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

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