+ Reply to Thread
Results 1 to 2 of 2

Search for a value, Copy Value into another cell

  1. #1
    Registered User
    Join Date
    10-23-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    16

    Search for a value, Copy Value into another cell

    Looking to search column W for all values over 57. Upon finding those, copy those numbers, and copy them into the cell in column T, on the same row.

    Below is the code i have so far. I have also tried using a combination of If statements and for loops, but nothing seems to work at this point.

    Thanks in advance!


    Sub Move()
    Application.ScreenUpdating = False

    Dim LR As Long, i As Long
    With Sheets("Sheet1")
    LR = .Range("A" & Rows.Count).End(xlUp).Row
    For i = 4 To LR
    With .Range("W" & i)
    If .Value > 57 Then
    Sheets("Sheet1").Range("w" & i).Copy Destination: Sheets("Sheet1").Range ("t" & i)

    End If
    Next i

    End With


    End Sub

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Search for a value, Copy Value into another cell

    this will error out:
    Please Login or Register  to view this content.
    based on what you're trying to do, it should be this:
    Please Login or Register  to view this content.
    furthermore, you are trying to search for the vals by attempting to loop through top to bottom, top row to bottom row. and this is the way to do that:
    Please Login or Register  to view this content.
    I don't even know if you can nest multiple WITH statements inside each other. If you can't it won't work either. I would assume you can though, as any other statement in any language can do it, so it should work fine.

+ 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. Search for a text string contained within a cell & copy to adjacent cell
    By Dobb_70 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-12-2020, 02:43 AM
  2. Search a String and copy specific cell into another cell
    By sampaio in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2019, 02:48 PM
  3. Replies: 4
    Last Post: 10-23-2018, 11:30 PM
  4. [SOLVED] VBA Lookup one cell Value and Search in Another Column, if Matches Copy Beside Cell value
    By pvsvprasad in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-04-2016, 11:38 PM
  5. if cell is blank search row and copy cell to different sheet
    By RandomPezzer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2016, 04:05 PM
  6. Replies: 8
    Last Post: 01-17-2014, 05:10 AM
  7. copy content from cell through search
    By lauranfsc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-23-2009, 04:12 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