Find value with 0

DT_User

New Member
Joined
Sep 24, 2008
Messages
21
I have a column of data that is sorted numerically largest to smallest. I am looking for macro code that will take me to the first row that has a value of 0 (zero)

Thanks for your help-David
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
This is set for Column A, change as necessary.

Code:
Sub test()
Dim x As Range
Set x = Range("A:A").Find(0, Cells(Rows.Count, 1))
If Not x Is Nothing Then x.Select
End Sub
 
Upvote 0
Thanks for the reply. However, when I run the macro it seems to take me to the row with the first number including a 0 to the left of the decimal. For example in the below data, the macro jumps to the row with the number 616,608.90 when I would like it to jump to the row with the first occurance of 0

1,365,412.30
1,239,147.00
831,634.80
748,545.70
719,691.00
616,608.90
536,078.70
535,532.60
-
-
-
-
 
Upvote 0
Code:
Sub test()
Dim x As Range
Set x = Range("A:A").Find(0, Cells(Rows.Count, 1), lookat:=xlWhole)
If Not x Is Nothing Then x.Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,635
Messages
6,120,660
Members
448,975
Latest member
sweeberry

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