Number of Rows and Columns

brepsenkamp

Board Regular
Joined
May 13, 2002
Messages
90
Hi everybody!

I need some help.

Is it possible to change the number of rows and columns to a worksheet/workbook.
When I open a specific file, I want to have let's say only 20 rows and 10 columns.
Is that possible??

Best regards,

Robert
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi�@Robert,

After select entire Rows or Columns, on main menu bar, select Options > Rows or Columns > Hide. :)
 
Upvote 0
You can either select all but 20 columns, right click and choose hide. Same with rows. Or you can run this procedure which will fo it for you.

Sub DownTo20x20()
Columns("U:IV").EntireColumn.Hidden = True
Rows("21:65536").EntireRow.Hidden = True
End Sub

Tom
 
Upvote 0
On 2002-11-16 06:07, brepsenkamp wrote:
Hi everybody!

I need some help.

Is it possible to change the number of rows and columns to a worksheet/workbook.
When I open a specific file, I want to have let's say only 20 rows and 10 columns.
Is that possible??

Best regards,

Robert

Hi

You say you want this action to happen when you open a specific workbook.

Go to a saved workbook. Open it. In the Top Left corner Right Click on the Excel logo. A drop down list should appear. Left Click on View Code. Paste A modified version of TS Toms code in the pane on the right hand side. Close and Save. Whenever you open the workbook it will be 20X10.

Private Sub Workbook_Open()
Columns("K:IV").EntireColumn.Hidden = True
Rows("21:65536").EntireRow.Hidden = True
End Sub
This message was edited by Jak on 2002-11-16 07:35
 
Upvote 0
Hi,

I am sorry to borrow you again but when I do the following for example:

Edit -> GoTo -> B50 you can still see what I have typed in there.

Is it not possible to create a worksheet with a typical number of rows and columns?

Regards,

Robert
 
Upvote 0
Hi Robert,

Besides Jak's suggestion...pls put following code into ThisWorkbook module.

:)<pre>
Option Explicit
Public rngTemp As Range

Private Sub Workbook_Open()
Set rngTemp = ActiveCell
Columns("U:IV").EntireColumn.Hidden = True
Rows("21:65536").EntireRow.Hidden = True
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Target.EntireRow.Hidden Or Target.EntireColumn.Hidden Then
Application.Goto rngTemp
Exit Sub
End If
Set rngTemp = Target
End Sub</pre>

_________________
HTH

With Regards,
Colo

This message was edited by Colo on 2002-11-16 07:36
 
Upvote 0
Nice one Colo

Note original range changed to K:IV to make 20x10. :)
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,428
Members
448,961
Latest member
nzskater

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