With Autofilter Macro, how to stop the cursor moving back to the first row & first cell?

tomripley

New Member
Joined
Jan 24, 2017
Messages
2
Hi,

My excel setup is like below, with the autofilter working on hidden columns. After filtering, for example, Item has A, B and D left (with the filter on). I then need to type Yes or No in the next for columns for A, B & D. So I type "Yes" in the column 2 row 2 cell and hit Enter and I expect to have the cursor in column 3 row 2. However, the Cursor would automatically move back to column 1 row 1 cell. I will have to click colum 3 row 2 to continue typing Yes Or No.

How can I stop the cursor moving back to column 1 row 1 and make the Enter key work as usual without autofilter? I tried to turn off the autofilter after each filter, but the cursor still goes back to the original place.

My macro code is something like below:

Dim a as long, b as long,

a = 1
b = worksheets("sheet1").Cells(a,1).EntireRow.Find(what:=Range(H1).value, LookIn:=xlformula, .......,SearchDirection:=xlNext)

*middle part omitted

Worksheets("sheet1").Range("B1").AutoFilter _
field :=lnCol, _
Criteria1:="x", )

*The filter criteria columns are hidden.



[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]Yes/No[/TD]
[TD]Yes/No[/TD]
[TD]Yes/No[/TD]
[TD]Yes/No[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
....


Really appreciate any insights!!
 
Hey Guys,

I think I just figured it out - I changed my code to that only certain cell changes would trigger the autofilter. Now that it makes sense, as every time I typed Yes/No, the autofilter was unnecessarily changed.

Thanks though!
 
Upvote 0

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