Macro(s) to Navigate (up and down) a list

rcicconetti

New Member
Joined
Jan 16, 2016
Messages
34
I would like to use buttons to navigate up and down a list of dates (D44:D344) and display the date in Cell K22.

I've been searching for a macro to assign to each button (previous date, next date), that will not only navigate the list, but also respect the beginning/end of the list without producing an error. If at the top of the list and "previous date" is clicked, then K22 = D44. If at the bottom of the list and "next date" is clicked l, then K22= D344.


I've tried several different ways using IfMatch, Offset, setting variables, etc., but can't seem to get it working 100%.

Any help would be greatly appreciated!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Test if the active cell is in row 44 or row 344 and either do nothing (Exit Sub) or raise a message box? The possible problem with a msgbox is that it can get annoying having to click to dismiss it. If you'd like to have a message, an option might be to use a small form and close it after 2 seconds.

When you have code already, it sometimes helps to provide more focused answers if you post it. Please use code tags - vba button on posting toolbar to maintain indentation and readability.
 
Upvote 0

Forum statistics

Threads
1,215,659
Messages
6,126,077
Members
449,286
Latest member
Lantern

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