• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Display Only few rows and columns

Hide all the Rows/Columns beyond what you want to see


or here is a simple VBA code that will toggle these area from Hidden to Visible

[pre]
Code:
Sub HideRowsCols()

If Application.Version < 13 Then
Columns("AA:IV").EntireColumn.Hidden = Not Columns("AA:IV").EntireColumn.Hidden
Rows("51:65536").EntireRow.Hidden = Not Rows("51:65536").EntireRow.Hidden
Else
Columns("AA:XFD").EntireColumn.Hidden = Not Columns("AA:XFD").EntireColumn.Hidden
Rows("51:1048576").EntireRow.Hidden = Not Rows("51:1048576").EntireRow.Hidden
End If

End Sub
[/pre]
 
your process works if i want to sit there and hide the rows and columns, tedious task.


the columns and rows that i dont hide. all i changed was the number and column.


Sub HideRowsCols()


If Application.Version < 13 Then

Columns("g:IV").EntireColumn.Hidden = Not Columns("g:IV").EntireColumn.Hidden

Rows("21:65536").EntireRow.Hidden = Not Rows("21:65536").EntireRow.Hidden

Else

Columns("g:XFD").EntireColumn.Hidden = Not Columns("g:XFD").EntireColumn.Hidden

Rows("21:1048576").EntireRow.Hidden = Not Rows("21:1048576").EntireRow.Hidden

End If


End Sub
 
My code with your Modification works perfectly?


What do you want to do ?


What version of Excel are you using ?
 
2007, i have a spreadsheet that someone sent to me that only displays columns a-f and row 1-19. they are not hidden and when i view the code for the sheet or workbook there is no code such as yours. i have possed the question to the person who sent it to me but they have no idea as the workbook was sent to them from another source.
 
Posting file refer here:

http://chandoo.org/forums/topic/posting-a-sample-workbook
 
https://skydrive.live.com/redir.aspx?cid=2b770c659a94550d&resid=2B770C659A94550D!102&authkey=jDtHRZDizDc%24
 
Back
Top