Copying Data based on number from one sheet to another
Closed
                                    
                        Aivaras                    
                                    -
                            Mar 18, 2015 at 03:43 PM
                        
MaxStart Posts 338 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 - Mar 21, 2015 at 10:37 PM
        MaxStart Posts 338 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 - Mar 21, 2015 at 10:37 PM
        Related:         
- Copying Data based on number from one sheet to another
 - How to copy data from one excel sheet to another - Guide
 - Excel move data from one sheet to another - Guide
 - Google sheet right to left - Guide
 - Windows network commands cheat sheet - Guide
 - Protect pdf from copying - Guide
 
1 response
                
        
                    MaxStart
    
        
                    Posts
            
                
            338
                
                            Registration date
            Tuesday March  3, 2015
                            Status
            Moderator
                            Last seen
            July  3, 2015
            
            
                    69
    
    
                    
Mar 21, 2015 at 10:37 PM
    Mar 21, 2015 at 10:37 PM
Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Cells(Target.Row, Target.Column).Value = "nar1" Then
    Cells(Target.Row, Target.Column).Value = Sheet2.Cells(1, 1).Value
    Cells(Target.Row, Target.Column + 1).Value = Sheet2.Cells(1, 1 + 1).Value
    Cells(Target.Row, Target.Column + 2).Value = Sheet2.Cells(1, 1 + 2).Value
    ElseIf Cells(Target.Row, Target.Column).Value = "nar2" Then
    Cells(Target.Row, Target.Column).Value = Sheet2.Cells(2, 1).Value
    Cells(Target.Row, Target.Column + 1).Value = Sheet2.Cells(2, 1 + 1).Value
    Cells(Target.Row, Target.Column + 2).Value = Sheet2.Cells(2, 1 + 2).Value
    End If
End Sub