Finding the last row that contains a value, of a column

riedyp

Board Regular
Joined
Feb 13, 2020
Messages
88
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am trying to select a cell in the last row that does not contain a 0. It is taking me to Row 54 but I want it to go to Row 37. The method I know is to go to a cell at the bottom of the sheet and "xlUp" so it will find the first value it finds. I want to do this but want to ignore all of the "0's" till it arrives at value "3.3" in Row 37.
Any method that would solve this would be greatly appreciated.
VBA Code:
Private Sub UpdateButton_Click()
NewRow = ActiveSheet.Cells(1000, 3).End(xlUp).Row 'Goes to the last updated cell
ActiveSheet.Cells(NewRow, 3).Select
End Sub
 

Attachments

  • Forumsnip.PNG
    Forumsnip.PNG
    31.6 KB · Views: 16
Actually, is there way for me to format that if any value in this range C24:C100 is = 0 then all of the values in that row are hidden?
 

Attachments

  • updated.PNG
    updated.PNG
    53.8 KB · Views: 10
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Filter?

If you use a format then you will have empty rows in the middle, (rows 28 and 33 in your example).

Either filter, or an array formula to pull only non 0 values, looking at your picture that will probably need an extra column in order to work.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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