Help! Finding empty cell..........

MGhell

Board Regular
Joined
Jan 16, 2006
Messages
85
Hi,

I have the following line which should give me the last blank cell in a given column. Unfortunately it seems that the code counts cells which contain formulas as non-empty cells. Is there a way to avoid this?

lastrow = Cells(Rows.Count, "K").End(xlUp).Row


Greetings

Max
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
mmm, I would think at that point you do a for next loop:

Code:
for cnt = Cells(Rows.Count, "K").End(xlUp).Row  to 1 step -1

  if Cells(cnt, "K").value <> "" then

    lastrow = cnt +1
    
    exit for

  end if

next cnt
 
Upvote 0
Hi,

you don't need the loop
Code:
lastrow = Columns("K").Find("*", [K1], xlValues, xlPart, xlByRows, xlPrevious, False, False).Row
kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,400
Members
448,893
Latest member
AtariBaby

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