Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Excel Macro help. Find data on one sheet, and grab the data from the next cell.?

I'm new to these macros, I need to know the correct commands.

So from sheet "calculation" in cell C4, i want to search for data in a sheet called "round" then take the data in the cell which is offset (0,1) and return it to C4. Any idea how to do that? thanks.

Thanks

Any ideas? All ive gotten it to do so far is return True in the cell next to the found data. Haha.

Update:

I cant use that function because there are multiple columns to search in. I've managed to get something working but it seems to grab any instance of the numbers rather than just cells with that EXACT number as the value.

Sub get_51_abundance()

Sheets("Calculation").Activate

Range("C4").Activate

Sheets("Round").Select

Range("A1").Select

Cells.Find(What:="51", After:=[A3], LookIn:=xlValues, LookAt:= _

xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True).Select

ActiveCell.Offset(0, 1).Range("A1").Select

Selection.Copy

Sheets("Calculation").Activate

Range("C4").Activate

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _

False, Transpose:=False

End Sub

I think just a minor change to one line might do it.

Update 2:

I got it, _xlPart in the search should have been _xlWhole. Thanks for the help though.

3 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    USE vlookup or hlookup function, it will be much easier for you

  • 1 decade ago

    For what you need to do, it would be easier to use the VLOOKUP function in Excel.

    To the left of the formula bar where you can enter in formulas for the Excel cells there is and fx. Click on that.

    That will bring up Excel's Insert Function dialog window. At the top of the window is a textbox where you can enter some text to search for a function. It should already be highlighted when the window opens so just type in VLOOKUP and click the Go button or hit Enter. Select VLOOKUP from the resulting list and click OK. That will bring up a window to help you with the VLOOKUP function. When you click in the different areas to enter text Excel will give you a helpful description down below as to what you enter there, etc.

  • 5 years ago

    uncertain with regard to the making sense, would desire to actual see the information to understand precisely what you're attempting to realize, however the technique isn't too complicated a job that it may no longer be dealt with by way of way of a VB functionality.

Still have questions? Get your answers by asking now.