Hi
Firstly, I don't know how to address you, even though I have read so
many of your postings over the years.
Is it Gary?
Secondly, that is excellent and adjusts to the relevant last column
without the user having to specify the column number.
However, could you explain the use of +r.Column - 1
r.column returns 1, hence I don't see why this has been included.
As a totally different alternative for the OP, and the way in which I
usually enable users to quickly enter data into an area of the sheet
with automatic dropping to the next row, is to set Scroll Area. This is
a toggle which switches on or off the scroll area on Sheet1
Sub LockArea()
If Sheets("Sheet1").ScrollArea = "$D$2:$M$1000" Then
Sheets("Sheet1").ScrollArea = ""
Else
Sheets("Sheet1").ScrollArea = "$D$2:$M$1000"
End If
End Sub
This sub has to be entered into a standard module of course, and
activated by selecting the macro (or its shortcut) first.
Whilst one needs to know in advance the area you are locking to, it has
the advantage of not using any processing power during data entry
looking at change events, and even if you do not enter data in the last
column, pressing enter will take you to the beginning of the next row.