Should be simple, but missing something - Formula or VBA to return value 4 columns over from searched text

pete3636

New Member
Joined
Jul 20, 2015
Messages
5
I am working with a large spreadsheet that contains specific names and 4 columns over contains a numerical value. What I would like to be able to do is search for the specific text and then have the formula return the value to the right.

Example:

Pete is located in cell C4, C12, E1, G5.

In column G4 is a numeric value - this should be returned for the Pete found in C4

There are various text strings I would have to look up so I would just have to repeat the formula for each different text. I can already do the simple lookup to find pete, I just cannot figure out how to have it return the cell 4 columns over

Any help is greatly appreciated!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Your answer can be found in the OFFSET function, which you could combine with a "find" function. For example,
ABCDEFGH
1Jon4
2Abe12.5

<tbody>
</tbody>

Code:
Sub findnames
Dim R as Range
Set R = Rows("1:100").Find(What:="Abe", LookIn:=xlFormulas, _ 
     LookAt:=xlPart, SearchOrder:=xlByRows)
If Not R Is Nothing Then
    Range("Z1") = R.value & " amount:"
    Range("Z1").Offset(0,1) = R.Offset(0,4).Value
End if
End sub
In the above example, Z1 = "Abe amount:", AA1 = 12.5
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,372
Messages
6,124,531
Members
449,169
Latest member
mm424

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top