Results 1 to 20 of 20

Copy and Paste in different locations depending on adjacent cell value

Threaded View

  1. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy and Paste in different locations depending on adjacent cell value

    Maybe:

    Sub FirstTryTime() 'ScabbyDog
    
    Dim rng As Range
    Dim ws2 As Worksheet: Set ws2 = Worksheets("Sheet2")
    Dim ws3 As Worksheet: Set ws3 = Worksheets("Sheet3")
    
                        ws2.Select
    
    For Each rng In Range("B2:B" & Range("B" & Rows.count).End(xlUp).Row)
        If rng = "Test" Then
              
            If rng.Offset(0, 2).Value = Range("C1").Value Then
                rng.Offset(0, -1).Copy ws3.Cells(3, "AJ")
                        End If
               
                        If rng(0, 2).Value = Range("D1").Value Then
                           rng.Offset(0, -1).Copy ws3.Cells(3, "AK")
                        End If
                            
                Exit For
                End If
    Next rng
    
    End Sub
    Last edited by xladept; 01-18-2016 at 12:39 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 01-03-2014, 03:01 AM
  2. [SOLVED] VBA for searching string in a column and copy rows depending on string in adjacent cell
    By xprakash in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-20-2013, 05:58 AM
  3. [SOLVED] VBA to copy & Paste Adjacent cell when value found
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 09-12-2013, 10:47 AM
  4. [SOLVED] find value, copy value of adjacent cell and paste it on another sheet
    By Ajgor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2012, 04:21 PM
  5. Copy and Paste macro depending on a cell
    By john_london in forum Excel General
    Replies: 4
    Last Post: 11-08-2010, 11:05 AM
  6. Copy and Paste Depending on Cell
    By Craig2097 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2010, 11:29 AM
  7. Copy & Paste values in adjacent cell
    By excelkeechak in forum Excel General
    Replies: 11
    Last Post: 12-05-2009, 07:11 PM

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