+ Reply to Thread
Results 1 to 3 of 3

How to move to cells after finding a search value

  1. #1
    Registered User
    Join Date
    05-03-2019
    Location
    Chennai, India
    MS-Off Ver
    MS Office 2007
    Posts
    2

    How to move to cells after finding a search value

    Hi All,

    I have Sheet 1 and Sheet 2, I have code to search a date from one sheet to another, but after I get my results, I want to add a formula in some of the cells in a row, like If I found the value in A10 in A:A, I wanted to add formulas in B10, D10, E10. Can anyone give me a code how to move cells after finding a search value.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,527

    Re: How to move to cells after finding a search value

    I guess it would help if you shared the code you have and, ideally, a sample workbook.


    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-03-2019
    Location
    Chennai, India
    MS-Off Ver
    MS Office 2007
    Posts
    2

    Re: How to move to cells after finding a search value

    Hi,

    Please find below the code.

    Sub Find_First()
    Dim FindString As Date
    Dim Rng As Range
    FindString = Sheets("Sheet1").Range("A1").Value
    If Trim(FindString) <> "" Then
    With Sheets("Sheet2").Range("A:A")
    Set Rng = .Find(What:=FindString, _
    After:=.Cells(.Cells.Count), _
    LookIn:=xlValues, _
    LookAt:=xlWhole, _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, _
    MatchCase:=False)
    If Not Rng Is Nothing Then
    Application.Goto Rng, True
    Else
    MsgBox "Nothing found"
    End If
    End With
    End If


    End Sub

    Thanks
    Last edited by Feroz90; 07-01-2019 at 06:16 AM.

+ 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. finding key word offset and repeat. plus move
    By brayboyce in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2019, 09:38 AM
  2. [SOLVED] search cells after finding a range
    By scott micklo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-19-2016, 12:54 PM
  3. Search Data and move results to "Search" worksheet
    By pvjon13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2015, 06:49 PM
  4. Search 2 excel files and move cells if match
    By 60thjeep in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2014, 09:27 AM
  5. Replies: 2
    Last Post: 11-07-2013, 01:56 PM
  6. Move and size with cells greyed out- form control checkboxes move after printing 2010
    By Duffy1974 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2012, 09:19 AM
  7. have reference cells move in rows while I move in columns
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2011, 09:33 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