ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Find empty cell then stop (https://www.excelbanter.com/excel-discussion-misc-queries/189060-find-empty-cell-then-stop.html)

Dolphinv4

Find empty cell then stop
 
Hi,

I'd like to have a macro that does this:

1) for cells in column F that is a) not empty & b) greater than 3000000,
search thru column K for the first empty cell. If there is, a message box to
be shown for the cell address. Then the whole macro should stop.

Thanks,
Dolphin

Bernie Deitrick

Find empty cell then stop
 
Perhaps?

Sub TryNow()
Dim myR As Long
Dim i As Long

myR = Cells(Rows.Count, 6).End(xlUp).Row

For i = 1 To myR
If Cells(i, 6).Value 3000000 And Cells(i, 11).Value = "" Then
MsgBox Cells(i, 11).Address
Exit Sub
End If
Next i
End Sub

HTH,
Bernie
MS Excel MVP


"Dolphinv4" wrote in message
...
Hi,

I'd like to have a macro that does this:

1) for cells in column F that is a) not empty & b) greater than 3000000,
search thru column K for the first empty cell. If there is, a message box to
be shown for the cell address. Then the whole macro should stop.

Thanks,
Dolphin





All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com