+ Reply to Thread
Results 1 to 5 of 5

Need to copy certain cells to different worksheet based on cell value

Hybrid View

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    42

    Need to copy certain cells to different worksheet based on cell value

    I have a spreadsheet in Excel 2013, that I am wanting to take certain cells in a row and copy them to another worksheet when a value greater than 4500 is entered into a specific cell in the same row.

    For example: In Worksheet A I have columns A:O with data, in cell E14 if an amount of >= 4500 is entered I want cell A14, C14, D14 and E14 to be copied to Worksheet B. In Worksheet B, they should be copied to the next available row, but I need them copied to specific cells (not the same as in Worksheet A- i.e: cell A14 would need to copy to cell A2 in Worksheet B; C14 to C2; D14 to D2 and E14 to E2). And the cells they would be copied to in Worksheet B would also need to be created in a new row.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need to copy certain cells to different worksheet based on cell value

    Maybe:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("E14")) Is Nothing Then
        If Target.Value >= 4500 Then
            Cells(Target.row, "A").Copy Sheets("Worksheet B").Range("A" & Rows.Count).End(3)(2)
            Cells(Target.row, "C").Copy Sheets("Worksheet B").Range("C" & Rows.Count).End(3)(2)
            Cells(Target.row, "D").Copy Sheets("Worksheet B").Range("D" & Rows.Count).End(3)(2)
            Cells(Target.row, "E").Copy Sheets("Worksheet B").Range("E" & Rows.Count).End(3)(2)
        End If
    End If
    End Sub

  3. #3
    Registered User
    Join Date
    02-06-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Need to copy certain cells to different worksheet based on cell value

    Thanks John, this works 100%!! I am just struggling to adjust the range to E14:G14?

  4. #4
    Registered User
    Join Date
    02-06-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Need to copy certain cells to different worksheet based on cell value

    Problem solved!
    Don't know why it didn't work earlier... thanks again!

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need to copy certain cells to different worksheet based on cell value

    You're welcome. Glad to help out and thanks for the feedback and the reps.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy data from a copied worksheet to another worksheet based on cell reference
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2013, 02:18 PM
  2. [SOLVED] Problem with macro intended to copy cells to a different worksheet based on cell value
    By Crangiopharengoma in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2013, 02:47 AM
  3. [SOLVED] copy data from cells in a column on one worksheet to a single cell in another worksheet
    By jpsnickers in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2013, 07:02 PM
  4. [SOLVED] Copy rows from one worksheet to another worksheet based on a cell criteria.
    By keneco in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-07-2013, 10:28 AM
  5. [SOLVED] Copy specific cells based on one word in the cell, to a different worksheet
    By Lfaulst1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2013, 05:26 PM
  6. need to copy some cells contents to a another worksheet based on a value condition
    By Mochmoch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2013, 10:39 AM
  7. [SOLVED] Copy rows from my main worksheet to another worksheet based on data in one cell
    By gcol in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-08-2012, 05:12 AM
  8. [SOLVED] Macro to copy certain cells to new worksheet based on cell value
    By mmctague in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-28-2012, 10:54 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