hiding unused rows using macros

  • Thread starter Thread starter cynthia.derama
  • Start date Start date
C

cynthia.derama

Hi all,

I'm having an issue making a macro to hide all unused rows from the
very last row possible to the last row with data in it. This is to be
used with imported data that will not be the same size every time its
imported. Can anyone help me?

-Cindy
 
Hi all,

I'm having an issue making a macro to hide all unused rows from the
very last row possible to the last row with data in it. This is to be
used with imported data that will not be the same size every time its
imported. Can anyone help me?

-Cindy

Here is an example of code:

Sub HideUnusedRows
 
Hi all,

I'm having an issue making a macro to hide all unused rows from the
very last row possible to the last row with data in it. This is to be
used with imported data that will not be the same size every time its
imported. Can anyone help me?

-Cindy

Here is an example of code that should do what you need:

Sub HideUnusedCode:

Range("A" & Cells(65536,1).end(xlup).row & ":A65536).entirerow.hidden
= true

End Sub

James
 
Here is an example of code that should do what you need:

Sub HideUnusedCode:

Range("A" & Cells(65536,1).end(xlup).row & ":A65536).entirerow.hidden
= true

End Sub

James

Third time lucky:

Sub HideUnusedCode:

Range("A" & Cells(65536,1).end(xlup).row &
":A65536").entirerow.hidden
= true

End Sub

This will be correct for all versions of Excel except Excel 2007, post
back if you will be using that version.

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top