Finding Next Blank Row!

DanBanez

New Member
Joined
Apr 16, 2008
Messages
41
Hi Guys,

I am an Excel beginner and I need help!

I have an Excel worksheet that contains 1,000 rows. I already have entered records on some of the rows. Is there a way that Excel will find the next blank row to input data?

Hope this makes sense!

Thanks in advance.

Dan Banez
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi Guys,

I am an Excel beginner and I need help!

I have an Excel worksheet that contains 1,000 rows. I already have entered records on some of the rows. Is there a way that Excel will find the next blank row to input data?

Hope this makes sense!

Thanks in advance.

Dan Banez

it depends how your data is set up, if the data is in row after row with no gaps a simple

selection.end(xldown).select
activecell.offset(1,0).select

will take you to the next blank row in the column you have selected

or you can do it in a loop

Code:
sub loop()
 
do
 
activecell.offset(1,0).select
 
loop until isempty(activecell.offset(1,0)) = true
 
or 
 
loop until activecell.value = ""

any of those will work
 
Upvote 0
Hi Again,

After the macro found the last blank row, let's say, 499, and I want to automatically delete Row 499 - Row 1,000. how do I code that?

Thanks again!

Dan Banez
 
Upvote 0
Hi Again,

After the macro found the last blank row, let's say, 499, and I want to automatically delete Row 499 - Row 1,000. how do I code that?

Thanks again!

Dan Banez

Code:
range("499:1000").select
selection.delete xlshiftup

if
 
Upvote 0
Hi TiaXL,

Thanks for the quick response!

It will work, but if I use that code, it will always go to the range 499-1000. But what if the last blank row is not 499 and let's say the last blank row is 525, then the code won't work.

What I was hoping for is a code that when the macro found the last blank row, it will delete that row, whatever it might be, all the way to row 1,000.

Thanks again.

Dan Banez
 
Upvote 0
Dan,

Are you trying to delete a second table? ie the first table from Row1 must remain everthing else after the first empty row must be deleted? Or is there more to this?
 
Upvote 0
Hi Trevor,

Here's what I was trying to do:

I have a spreadsheet that contains names, addresses, etc. of donors. The spreadsheet has 1,000 rows, although it has only 475 donors. I have 1,000 rows because I don't want to keep on adding rows when I add donors. There must be an easier way, but I am new to this.

When I query donors, and let's say the query produced only 300 names. These names will appear on my "output range" which also has 1,000 rows. Also, these names will appear on my "merge files" which also has 1,000 rows.

Since I don't want to mess up my "output range", I want to delete rows 301-1000 from my merge file, which I use to "merge" with my MS Word document that I send to these donors. If I don't delete rows 301-1000, they will merge with my MS Word document and produce 700 blank documents.

Hope this makes sense!

Thanks.

Dan Banez
 
Upvote 0
Code:
Sub Deleting()
Range(Cells(Range("A1").CurrentRegion.Rows.Count + 1, 1), Cells(1000, 1)).EntireRow.Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

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