Find first empty row code


Active Member
Mar 1, 2009
Hi, I currently have this code in my excel form that once data is entered in the form, it looks for the first empty row in the worksheet to start copying the data. Well, row 1 and row 2 in the worksheet it posts the data to are header rows, but my problem is row 3 has some formulas in a couple of the columns, and so I have it hidden and when new data is entered in copies down those formulas from that row. So basically what I'm saying is I want it to skip over row 3 and the first time data is entered start at row 4 then go down from there. Here is the current code:

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

How would I modify that so that it will start at row 4 instead of row 3 when I enter in the very first entry into the form? Thanks!

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.


Jun 19, 2002

iRow = WorksheetFunction.Max(4, ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row)

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...