Ask Experts Questions for FREE Help !
Ask
    traka's Avatar
    traka Posts: 50, Reputation: 1
    Junior Member
     
    #1

    Jul 4, 2005, 06:34 AM
    Code alteration help
    I have done some extensive searches and have asked in expert forums for excel, but can't seem to get the right answer. So here goes.
    The code below is as close as I can find, but the situation is like this.

    Excel Workbook
    Sheet 1
    Sheet 2
    ----------------------
    Sheet 1 Cell A1
    Fixed value ( number or text )
    Fixed value means it is always in A1, but the actual value constaly changes.
    When it changes, the new value will still be in A1
    -------
    Sheet 2
    will have the same value as in A1, but anywhere within that sheet.
    I need to find the value of A1 Sheet 1, in Sheet 2.
    The rest of the code can take care of the rest because copies a section from the found location in Sheet 2.
    Let's say it finds the value of A1 in BB 467 of Sheet 2.
    From there the rest of the code will do a set range select and copy the data.
    That's OK, I can deal with that part, but it's finding it with macro code.
    --------
    The code I was shown, one has to type in the contents of A1.
    It is not required to type in, it's already there. ( but constantly changes)
    But it looks like this:
    ---------------

    Sub Find_First()

    Dim FindString As String
    Dim Rng As Range
    FindString = InputBox("Enter a Search value")

    If Trim(FindString) <> "" Then
    Set Rng = Range("A:A").find(What:=FindString, _
    After:=Range("A" & Rows.Count), _
    LookIn:=xlFormulas, _
    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 If
    End Sub


    ---------
    Where it has :
    FindString = InputBox("
    End If
    End If
    End Sub


    ---------
    Where it has :
    FindString = InputBox(")
    I can't seem to find the right syntax so the "Search Value" is whatever is in Sheet 1 A1 then go to Sheet 2 and see if it is there.
    Much appreciated.

Check out some similar questions!

Code 19 with my Optical drives! [ 14 Answers ]

I was cleaning out my hard drive and streamlining my startup files and when I was done neither of my optical drives worked (CDRW and DVD+RW - both Buslink). Neither of them show up in "My Computer" and both have yellow !'s next to them in the device manager. At first when I clicked on them in the...

Need help in VB Code [ 1 Answers ]

Good day, Iam traying to get result of my record as below If next record is biger than previous show "1" If next record is same previous show "1" If next record is smallest show "0" if next record is same previous show "0" Example

DaVinci Code [ 57 Answers ]

WARNING, if anyone has not read the book and wants to or plans on seeing the movie instead, I suggest they not read this thread. Discussion of the themes of the book may reveal plot twists and spoil enjoyment of the book. I just finished reading the book and found it very interesting. It's a...

Davinci Code [ 61 Answers ]

Just looking for thoughts and comments on the movie and book Davinci Code

Decode code [ 1 Answers ]

I am very happy to know about you. Please I am a Cameroonian and having a cingular phone with the following details. What happen with the phone is that my small brother took it and not knowing the operatings,entered a code that he could no longer remember.It show that he had changed the...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.