enter in last row in a set range

Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,075
Office Version
  1. 2019
Platform
  1. Windows
I would like to enter an entry from the last row of a table that ends at A12. Using the code below is only useful if I use the entire range (A:A). Since I have limited my entries (A3:A12), I would like to check for the last empty row in rows A3:A12 and make my entry. How can I adjust the code to accomplish this task. Thanks

Code:
LastRow = Range("A" & Rows.Count).End(xlUp).Row + 1 'Finds the last blank row
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Is there already something in A1 and A2?
What happens is all ten rows of column A are already populated (A3:A12)?
 
Upvote 0
Is there already something in A1 and A2?
What happens is all ten rows of column A are already populated (A3:A12)?


Rows A1:A2 are Title headers.
The table is set to be limited to only 10 rows. (A3:A12)

A13 and lower is used for other information
 
Upvote 0
It's working fine with me! No need for any adjustment.


I have a data from A13 and below. I want to search for the last empty row from the range (A3:12) only. Since I have table from A13 and below, its reading that information.
 
Upvote 0
How about
Code:
Sub NextBlank()
   LastRow = Range("A:A").SpecialCells(xlBlanks)(1).Row
End Sub
 
Upvote 0
Glad you got a solution.
You didn't answer this question:
What happens if all ten rows of column A are already populated (A3:A12)?
Maybe that is not a possibility, but if it is, you will need to check for that and account for that.
 
Upvote 0
Glad you got a solution.
You didn't answer this question:

Maybe that is not a possibility, but if it is, you will need to check for that and account for that.

I inserted the code below to trigger a message indicating the table is full.


Code:
If Range("A12") > vbNullString
 
Upvote 0
Just another possible way (and just in case there ever could be 2 blanks in the range)...

Code:
Range("A3:12").Find("*", , xlValues, , xlByRows, xlPrevious)(2).Row
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,629
Members
452,661
Latest member
Nonhle

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