# Last non blank cell with number in column

#### QuantMan

##### New Member
Hi,

Any idea how I tweak this to make the last non-blank cell with a number (only).

Function LastNonBlankCell(Range As Excel.Range) As Variant
Application.Volatile
LastNonBlankCell = Range.End(xlDown).Value
End Function

### Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Try this...

Code:
``````[color=darkblue]Function[/color] LastNonBlankNumericCell(Rng [color=darkblue]As[/color] Excel.Range) [color=darkblue]As[/color] [color=darkblue]Variant[/color]
[color=darkblue]Dim[/color] v [color=darkblue]As[/color] [color=darkblue]Variant[/color], i [color=darkblue]As[/color] [color=darkblue]Long[/color]
v = Intersect(Rng.Parent.UsedRange, Rng).Value
LastNonBlankNumericCell = [color=darkblue]CVErr[/color](xlErrNA)
[color=darkblue]For[/color] i = [color=darkblue]UBound[/color](v, 1) [color=darkblue]To[/color] 1 [color=darkblue]Step[/color] -1
[color=darkblue]If[/color] Len(v(i, 1)) And IsNumeric(v(i, 1)) [color=darkblue]Then[/color]
LastNonBlankNumericCell = v(i, 1)
[color=darkblue]Exit[/color] [color=darkblue]For[/color]
[color=darkblue]End[/color] [color=darkblue]If[/color]
[color=darkblue]Next[/color] i
[color=darkblue]End[/color] [color=darkblue]Function[/color]``````

Works great. Thx AlphaFrog

Replies
2
Views
652
Replies
7
Views
264
Replies
1
Views
389
Replies
2
Views
197
Replies
11
Views
426

1,207,436
Messages
6,078,549
Members
446,347
Latest member

### 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.

### Which adblocker are you using?

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

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