ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Locating first blank cell (https://www.excelbanter.com/new-users-excel/38430-locating-first-blank-cell.html)

Mike W

Locating first blank cell
 
I am looking for a macro that will select the first blank (empty) cell in a
given column please.

Thanks,

Mike



Harald Staff

Hi Mike

Sub test()
Dim GivenColumn As Long
GivenColumn = 1
Columns(GivenColumn).Find(What:="", _
After:=Cells(1, GivenColumn), _
LookAt:=xlWhole).Select
End Sub

HTH. Best wishes Harald

"Mike W" skrev i melding
...
I am looking for a macro that will select the first blank (empty) cell in

a
given column please.

Thanks,

Mike





Mike W

Brilliant Harald, just what I was trying to do myself, thank you.

Mike

"Harald Staff" wrote in message
...
Hi Mike

Sub test()
Dim GivenColumn As Long
GivenColumn = 1
Columns(GivenColumn).Find(What:="", _
After:=Cells(1, GivenColumn), _
LookAt:=xlWhole).Select
End Sub

HTH. Best wishes Harald

"Mike W" skrev i melding
...
I am looking for a macro that will select the first blank (empty) cell

in
a
given column please.

Thanks,

Mike







prizm1

Harald Staff wrote:
Hi Mike

Sub test()
Dim GivenColumn As Long
GivenColumn = 1
Columns(GivenColumn).Find(What:="", _
After:=Cells(1, GivenColumn), _
LookAt:=xlWhole).Select
End Sub

HTH. Best wishes Harald

"Mike W" skrev i melding

If the column cell contains space characters instead of an empty string,
how would TRIM$ work inside this macro to find the first empty or
space(s)-only filled cell in the given column?





...

I am looking for a macro that will select the first blank (empty) cell in


a

given column please.

Thanks,

Mike







All times are GMT +1. The time now is 03:55 PM.

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