Results 1 to 4 of 4

Macro stopped working. Copy cells from one sheet over to another based on adjacent cells.

Threaded View

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    waco, texas
    MS-Off Ver
    Excel 2003
    Posts
    6

    Macro stopped working. Copy cells from one sheet over to another based on adjacent cells.

    So what this macro did was look at two columns on one sheet. Column A contained user names, column B contained their emails. Then it would replace everyone's name on a different sheet with their emails. However, now it only does it once, and if the name shows up more than once, the extras don't get replaced by the email. My understanding of VBA is almost non-existant. Please help?


    Sub CopySGASheet1()
    
    On Error Resume Next
    
    Dim Cell As Range, Ncell As String, dest As Range
    
    Worksheets("SGA LIST").Activate 'chose your "from" worksheet
    
    For Each Cell In Range("A1", Cells(Rows.Count, 1).End(xlUp))
    
        Cell.Activate
        
            Cell.Offset(0, 1).Copy
        
            Ncell = Cell.Value
            
            Worksheets("Sheet1").Activate 'chose your destination worksheet
        
            Set dest = Cells.Find(What:=Ncell, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
            xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
            , SearchFormat:=False)
             
            dest.PasteSpecial xlPasteValues
            
            Worksheets("SGA LIST").Activate 'chose your "from" worksheet again
            
                
        Next Cell
    
    End Sub
    Last edited by cekenney; 07-16-2014 at 02:51 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro stopped working - please help
    By kellynicolebarrett in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-01-2014, 05:49 AM
  2. Macro stopped working
    By EverettRich in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-21-2013, 03:17 PM
  3. Macro Stopped Working
    By andybason in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2012, 01:20 PM
  4. Macro stopped working.
    By joleen in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-06-2011, 05:37 AM
  5. Excel 2007 : Macro stopped working
    By jaw0001 in forum Excel General
    Replies: 5
    Last Post: 10-13-2010, 07:59 AM

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