MACRO:Find-Arrow

32CARDS

Board Regular
Joined
Jan 1, 2005
Messages
123
Example Code:
Sub Macro5()
'
' Macro5 Macro
Cells.Find(What:="here", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate

'arrow key right !! NOT Cell D7

Range("D7").Select

End Sub
====================================================
The Issue:

The "Find *here*" part of the script is fine, but the "Range ("D7).Select"
has to be a "arrow key" direction from wherever the cell with "find" is located, but not specificaly cell D7.

====================================================
The question:

What is the macro code for "arrow key" left,right,up and down" ?
It then has to copy the contents of the cell, right of "find"


Answer/s:


===========================================================

Thanks in advance
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Colo

MrExcel MVP,
Joined
Mar 20, 2002
Messages
1,456
Hi 32CARDS,
The OFFSET property makes it possible.
Just use
Code:
Selection.offset(0,-1).Select
instead of
Code:
Range("D7").Select
.

Left : Offset(0,-1)
Right: Offset(0,1)
Up: Offset(-1,0)
Down: Offset(1,0)

Note: 0 can be omitted, so you can just write Offset(1) when you'd like to specify Down. Offset(,1) stands for Right.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,194
Messages
5,768,775
Members
425,492
Latest member
blueexcel123

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
Top