Limit worksheet for 50 rows only

S

Shazi

Hi,

I want to make a procedure that allow to sheet1 for 50 rows of data
only.

or

How I can limit the worksheet only for 50 rows data entry, If I will
hide all the rows from 51 to bottom.

is it possible, that when user reach row number 50 then he get the
message "your data entry limit is finished, make new worksheet".

Regards.

Shahzad
 
C

Corey

pretty crude but if a cell in the 50th row or beyond is selected you could
use a promt like:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Row >= 50 Then MsgBox "The Sheet is Full" & vbcrlf & " Please
start a New Sheet"
End Sub
 
S

Shazi

pretty crude but if a cell in the 50th row or beyond is selected you could
use a promt like:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Row >= 50 Then MsgBox "The Sheet is Full" & vbcrlf & " Please
start a New Sheet"
End Sub








- Show quoted text -

Hi,

I used your code, but its not enough, after getting the message, user
can still enter the data, I want to see only Row1 to Row 50 only.

regards.

shahzad
 
P

Peter T

Right click the sheet tab, View Code
In the Properties panel for the worksheet (if necessary F4)
enter your your address as appropriate in the ScrollArea property, eg
1:50
or
A1:M50
 
S

Susan

sub Shazi()

dim ws as worksheet
dim wb as workbook

set wb = activeworkbook

for each ws in wb.worksheets
Rows("51:65536").EntireRow.Hidden = True
next ws

end sub

========================
run once for the whole workbook.
hth
susan
 
M

Mike H

hi,

Select the entire sheet by click the box at the intersect of row/column
headings then

data|Validation
Select 'Custom'
Enter the formula

=Row()<=50

Mike
 
S

Shazi

sub Shazi()

dim ws as worksheet
dim wb as workbook

set wb = activeworkbook

for each ws in wb.worksheets
     Rows("51:65536").EntireRow.Hidden = True
next ws

end sub

========================
run once for the whole workbook.
hth
susan





- Show quoted text -



Dear Susan,

Dear Mike,

Dear Peter,


Thank you very much for your suggessions, really very good idea you
sent to me, I will go through Susan's code. Thanks a lot of your
help.

with best regards.


Shahzad
Madinah
 

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

Top