Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Programming problem

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell

within the specefic range that i will provide .
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Programming problem

Use Data Validation.
--
Gary''s Student - gsnu200856


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell

within the specefic range that i will provide .

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Programming problem

Thanks dear but i want to fixed the cell eg (a1 or b1) through vb program.
can you wrote it in vb. thanks for cooperation.


imran


"Gary''s Student" wrote:

Use Data Validation.
--
Gary''s Student - gsnu200856


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell

within the specefic range that i will provide .

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Programming problem

Hi Imran

1. Use Data validtionAllow Whole number Select the minimum and maximum and
from error alert tab "You can place a customized message"

2. If you want to have this programatically use the worksheet change event.
Chanage the range to suit your requirement.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell

within the specefic range that i will provide .

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Programming problem

Thanks jacob, yes it is working through data validation but i want to control
it through vb programming as you mentioned below option2. but option vb
program is not working. i want to set the value with in a limit in a specific
cell eg. (a1 or b1) through vb same through minimum value to maximum value.
waiting your reply.

"Jacob Skaria" wrote:

Hi Imran

1. Use Data validtionAllow Whole number Select the minimum and maximum and
from error alert tab "You can place a customized message"

2. If you want to have this programatically use the worksheet change event.
Chanage the range to suit your requirement.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell

within the specefic range that i will provide .



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Programming problem

Dear Jacob thanks dear vb programm is also working now but if i want to same
for another cell then how i can fix same with "a1" cell and "b1" & c1". can
you help me to fixed the 3 or 4 cell with in a program.

thanks in advance
imran

"Jacob Skaria" wrote:

Hi Imran

1. Use Data validtionAllow Whole number Select the minimum and maximum and
from error alert tab "You can place a customized message"

2. If you want to have this programatically use the worksheet change event.
Chanage the range to suit your requirement.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell

within the specefic range that i will provide .

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Programming problem

Imran, change the range in App,Intersect as below...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

Dear Jacob thanks dear vb programm is also working now but if i want to same
for another cell then how i can fix same with "a1" cell and "b1" & c1". can
you help me to fixed the 3 or 4 cell with in a program.

thanks in advance
imran

"Jacob Skaria" wrote:

Hi Imran

1. Use Data validtionAllow Whole number Select the minimum and maximum and
from error alert tab "You can place a customized message"

2. If you want to have this programatically use the worksheet change event.
Chanage the range to suit your requirement.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell
within the specefic range that i will provide .

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Programming problem

Dear Jacob,

for A1 value range is 5-100
for B1 value range is 101-200
for C1 value range is 201-300

really i am very thank full to you for your kind support

"Jacob Skaria" wrote:

Imran, change the range in App,Intersect as below...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

Dear Jacob thanks dear vb programm is also working now but if i want to same
for another cell then how i can fix same with "a1" cell and "b1" & c1". can
you help me to fixed the 3 or 4 cell with in a program.

thanks in advance
imran

"Jacob Skaria" wrote:

Hi Imran

1. Use Data validtionAllow Whole number Select the minimum and maximum and
from error alert tab "You can place a customized message"

2. If you want to have this programatically use the worksheet change event.
Chanage the range to suit your requirement.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell
within the specefic range that i will provide .

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Programming problem

Imran. try the below and feedback

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
ElseIf Not Application.Intersect(Target, Range("B1")) Is Nothing Then
If Target.Value < 101 Or Target.Value 200 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
ElseIf Not Application.Intersect(Target, Range("C1")) Is Nothing Then
If Target.Value < 201 Or Target.Value 300 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

Dear Jacob,

for A1 value range is 5-100
for B1 value range is 101-200
for C1 value range is 201-300

really i am very thank full to you for your kind support

"Jacob Skaria" wrote:

Imran, change the range in App,Intersect as below...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

Dear Jacob thanks dear vb programm is also working now but if i want to same
for another cell then how i can fix same with "a1" cell and "b1" & c1". can
you help me to fixed the 3 or 4 cell with in a program.

thanks in advance
imran

"Jacob Skaria" wrote:

Hi Imran

1. Use Data validtionAllow Whole number Select the minimum and maximum and
from error alert tab "You can place a customized message"

2. If you want to have this programatically use the worksheet change event.
Chanage the range to suit your requirement.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell
within the specefic range that i will provide .

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Programming problem

Imran. try the below and feedback

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
ElseIf Not Application.Intersect(Target, Range("B1")) Is Nothing Then
If Target.Value < 101 Or Target.Value 200 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
ElseIf Not Application.Intersect(Target, Range("C1")) Is Nothing Then
If Target.Value < 201 Or Target.Value 300 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

Dear Jacob,

for A1 value range is 5-100
for B1 value range is 101-200
for C1 value range is 201-300

really i am very thank full to you for your kind support

"Jacob Skaria" wrote:

Imran, change the range in App,Intersect as below...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

Dear Jacob thanks dear vb programm is also working now but if i want to same
for another cell then how i can fix same with "a1" cell and "b1" & c1". can
you help me to fixed the 3 or 4 cell with in a program.

thanks in advance
imran

"Jacob Skaria" wrote:

Hi Imran

1. Use Data validtionAllow Whole number Select the minimum and maximum and
from error alert tab "You can place a customized message"

2. If you want to have this programatically use the worksheet change event.
Chanage the range to suit your requirement.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell
within the specefic range that i will provide .



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Programming problem

Thank you very much jacob but i want to fixed the cells with differend value
ranges through this we can fixed a same value range for given range cells.

thanks

Imran

"Jacob Skaria" wrote:

Imran, change the range in App,Intersect as below...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:C1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

Dear Jacob thanks dear vb programm is also working now but if i want to same
for another cell then how i can fix same with "a1" cell and "b1" & c1". can
you help me to fixed the 3 or 4 cell with in a program.

thanks in advance
imran

"Jacob Skaria" wrote:

Hi Imran

1. Use Data validtionAllow Whole number Select the minimum and maximum and
from error alert tab "You can place a customized message"

2. If you want to have this programatically use the worksheet change event.
Chanage the range to suit your requirement.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 5 Or Target.Value 100 Then
MsgBox " Invalid Entry": Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Imran" wrote:

I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the cell
within the specefic range that i will provide .

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Programming problem


Imran;371551 Wrote:
I want to fixed the cell to enter the data in specific range 5 to 100 or
100. basically i want to lock the worksheet cell and enter data in the

cell
within the specefic range that i will provide .Locking cells will not do anything unless you protect the worksheet.



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=104040

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Programming problem


Imran;371551 Wrote:
I want to fixed the cell to enter the data in specific range 5 to 100
or
100. basically i want to lock the worksheet cell and enter data in the

cell
within the specefic range that i will provide .You want to lock all other cells except the range you specify?



--
The Code Cage Team

Regards,
The Code Cage Team
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=104040

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
Problem programming a formula CB Excel Programming 5 March 9th 09 08:40 PM
Programming problem. JonathanW Excel Programming 1 May 7th 07 04:42 PM
How would I do this programming problem? Brett Smith[_2_] Excel Programming 0 January 18th 06 12:50 AM
Programming the Progress Bar problem Jeff Excel Programming 7 February 2nd 05 12:52 AM
Excel programming problem Peter Hansson Excel Programming 2 November 9th 03 03:19 PM


All times are GMT +1. The time now is 02:01 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"