#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 46
Default number of columns

Good day,
I would like to know if it is possible to set a worksheet to only have let's
say columns A to G and 1 to 10
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default number of columns

Not really, but you make it look like so.
FormatColumnHide, same for Rows

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"ekkeindoha" wrote in message ...
| Good day,
| I would like to know if it is possible to set a worksheet to only have let's
| say columns A to G and 1 to 10


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default number of columns

I would like to know if it is possible to set a worksheet to only
have let's say columns A to G and 1 to 10


You could do this. Click on the H in column H's header to highlight the
entire column. Next, depress and hold down the Control and Shift keys...
while they are down, press the End key followed by the Right Arrow key. This
will select all the columns from column H to the end of the grid. Next,
click Format/Column/Hide from the Excel menu. Only columns A through G
should remain visible. Now, click the 11 in row 11's header, depress the
Control and Shift keys followed by the End key and Down Arrow key. Click
Format/Row/Hide and you should be left with what you asked for.

Rick

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 947
Default number of columns

I would like to know if it is possible to set a worksheet to only have
let's
say columns A to G and 1 to 10


Another option might be to place code like this on the specific worksheet
module.
Maybe you can use some ideas he

Private Sub Worksheet_Activate()
Dim r As Long
Dim c As Long
Dim Nr As Long
Dim Nc As Long
Dim Rng As Range

Set Rng = [A1:G10]

r = Rng.Rows.Count
c = Rng.Columns.Count
Nr = Rows.Count
Nc = Columns.Count

ActiveSheet.Unprotect
ActiveSheet.ScrollArea = vbNullString ' ???
Rng.Locked = False 'Your Choice here ??

Rng.Rows(1).Offset(r).Resize(Nr - r).Hidden = True
Rng.Columns(1).Offset(, c).Resize(, Nc - c).Hidden = True

ActiveSheet.Protect
End Sub

--
Dana DeLouis



"ekkeindoha" wrote in message
...
Good day,
I would like to know if it is possible to set a worksheet to only have
let's
say columns A to G and 1 to 10



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default number of columns

You can hide what you don't want to see as others have pointed out.

You can also set the scrollarea to a fixed range.

Since the scrollarea method does not stick between sessions you will have to
reset it each time you open the workbook.

You may wish to place the code into a WorkBook_Open Sub in ThisWorkbook module
and specify which worksheet if only one sheet required.

Adjust the sheetname and range to suit.

Private Sub WorkBook_Open()
Sheets("YourSheet").ScrollArea = "A1:G10"
End Sub

Or also in the Thisworkbook module to limit scrollarea on all sheets.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
With ActiveSheet
.ScrollArea = "A1:G10"
End With
End Sub


Gord Dibben MS Excel MVP

On Sun, 8 Jul 2007 01:52:03 -0700, ekkeindoha
wrote:

Good day,
I would like to know if it is possible to set a worksheet to only have let's
say columns A to G and 1 to 10


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of columns Duplex Excel Discussion (Misc queries) 3 October 20th 06 02:02 PM
Max number of columns? Al Excel Discussion (Misc queries) 1 March 17th 06 11:46 AM
Number of Columns Pedro Mestre Excel Discussion (Misc queries) 2 October 20th 05 11:24 AM
Number of columns ? Toosje Excel Worksheet Functions 2 March 16th 05 11:41 AM
limited number of columns Katja Excel Discussion (Misc queries) 0 February 5th 05 03:21 PM


All times are GMT +1. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"