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
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Colo

MrExcel MVP,
Joined
Mar 20, 2002
Messages
1,456
Hi�@Robert,

After select entire Rows or Columns, on main menu bar, select Options > Rows or Columns > Hide. :)
 
L

Legacy 98055

Guest
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
 

Jak

Well-known Member
Joined
Apr 5, 2002
Messages
807

ADVERTISEMENT

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
 

brepsenkamp

Board Regular
Joined
May 13, 2002
Messages
90
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
 

Colo

MrExcel MVP,
Joined
Mar 20, 2002
Messages
1,456

ADVERTISEMENT

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
 

Jak

Well-known Member
Joined
Apr 5, 2002
Messages
807
Nice one Colo

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

Watch MrExcel Video

Forum statistics

Threads
1,122,335
Messages
5,595,569
Members
413,996
Latest member
mabelO

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
Top