English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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.

2007-11-05 05:29:37 · 3 answers · asked by billgoats79 5 in Computers & Internet Programming & Design

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.

2007-11-06 01:29:37 · update #1

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

2007-11-06 01:56:34 · update #2

3 answers

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

2007-11-05 05:37:55 · answer #1 · answered by Anonymous · 1 0

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.

2007-11-06 00:59:08 · answer #2 · answered by devilishblueyes 7 · 1 0

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.

2016-11-10 08:48:30 · answer #3 · answered by purifory 4 · 0 0

fedest.com, questions and answers