Hide rows after last entry macro

Buns1976

Board Regular
Joined
Feb 11, 2019
Messages
194
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

We import approximately 400 rows of data into a spreadsheet. I would like to hide all rows after the last entry with a macro.
The caveat is that the last populated row is not the same each day so today might be 374 and tomorrow might be 402.

Any help would be appreciated!

Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
How about
Code:
Sub Buns1976()
   Range(Range("A" & Rows.Count).End(xlUp).Offset(1).Row & ":" & Rows.Count).EntireRow.Hidden = True
End Sub
 
Upvote 0
Hi Fluff,

That hides all the rows in the sheet! We just want to hide rows after the last entry please.

Thanks
 
Upvote 0
Which column will always have a value on the last row?
 
Upvote 0
Hi Fluff,

My bad. I missed "A". Changed to "B" and all is good. Sorry!
Quick question off topic a bit. I'm running a macro that inserts
today's Date in B2. In the formula bar I see 4/4/2019 but cell B2
is blank?

Thanks a bunch!
 
Upvote 0
You're welcome & thanks for the feedback

Sounds like you either have conditional formatting on that cell, or a custom number format.
 
Upvote 0
Another possibility is the font is the same as the fill colour.
 
Upvote 0
Hi Fluff,

or white text on a white background.....I'm losing my mind!!

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,633
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