RE: Programming problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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 validtion>Allow 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 .
.



Relevant Pages

  • Re: C vs. C++
    ... be better for this kind of programming. ... Reserved keywords are troublesome because when you need a new one, ... If you opt to reuse an old one, you wreck the language. ... jacob at jacob point remcomp point fr ...
    (comp.lang.c)
  • Re: Protect format and programming on cells and columns from change
    ... Data Validation, maybe? ... You could also program copy commands which only paste formulas. ... Teaching users to enter the data correctly (and depending on them dong ... Programming tools ought to give the developer a way to make ...
    (microsoft.public.excel)
  • Re: Auto-complete an entry in drop-down list
    ... "Debra Dalgleish" wrote: ... > If you created the dropdown list through Data Validation, ... If you can use programming, ... >> like to be able to type the first letter or two and get a list of available ...
    (microsoft.public.excel.newusers)
  • Re: Library bug or my fault?
    ... suspect that when discussing problems in C programming TODAY we should ... NOT confuse everyone with obsolete machines. ... part of the 99.9% of the world using a modern operating system on modern ... jacob at jacob point remcomp point fr ...
    (comp.lang.c)
  • Re: "Criticism of the C programming language ??????"
    ... PH> compiler vendors didn't bother because the programming ... so important that it have ANSI/ISO's imprimatur? ... jacob at jacob point remcomp point fr ...
    (comp.lang.c)