Return to top of list on vlook and clear button

MarkDShark

Board Regular
Joined
Jun 10, 2008
Messages
228
I need a code added that will return vlook list back to the first entry open hitting the clear button.

The first entry on my VLOOK list, is "Select". Need to be able to hit clear, then the list to revert back to the top of the list. Code used below. Thanks!

Sub clear_data0101()
'
' clear_data0101 Macro
' Macro recorded 9/2/2011 by TSXFB
'
'
Range("C16:C25").Select
Selection.ClearContents
Range("F16:F25").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=18
Range("C39:C48").Select
Selection.ClearContents
Range("F39:F48").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-24
Range("B10:F10").Select
Range("C16").Select
Selection.ClearContents
End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I'm not entirely sure what you need this code to do but it can be cleaned up and rewritten like so...

Code:
Sub clear_data0101()
'
' clear_data0101 Macro
' Macro recorded 9/2/2011 by TSXFB
'
'
Range("C16:C25, F16:F25, C39:C48, F39:F48, B10:F10").ClearContents
End Sub
 
Upvote 0
Well im using VLOOK to reference what i select in a drop down list and to populate another cell with an entry. The begging on the list, is the word 'Select". What i wanted the clear button to do, is clear the sheet and then clear the list and revert it back to "select" which is the top entry.
 
Upvote 0
Can you post a sample of your spreadsheet please?
 
Upvote 0

Forum statistics

Threads
1,224,559
Messages
6,179,515
Members
452,921
Latest member
BBQKING

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