PC Review


Reply
Thread Tools Rate Thread

Checking some values in Workbook

 
 
Gert-Jan
Guest
Posts: n/a
 
      18th Oct 2006
I have a userform with some texboxes and comboboxes. If the user types or
select something, that data will be written to cells. (Sheet1A1, Sheet2B15,
Sheet3K29, etc.)
That input must be checked before it can be stored in the database. If the
cells doesn't contain proper data, the commandbutton1 must be disabled. I
would like to know how create a macro that checks all these specific cells.
Should I use select case?

Thanks for helping, Gert-Jan


 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      18th Oct 2006
How will you initiate the checks. Normally it would be clicking a button,
such as the OK button, then just look at each value and test it. If they are
okay, write them away, else throw up an error message.

Select Case might be a strategy, but there is too little info to advise.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Gert-Jan" <(E-Mail Removed)> wrote in message
news:4535eae1$0$27817$(E-Mail Removed)...
> I have a userform with some texboxes and comboboxes. If the user types or
> select something, that data will be written to cells. (Sheet1A1,

Sheet2B15,
> Sheet3K29, etc.)
> That input must be checked before it can be stored in the database. If the
> cells doesn't contain proper data, the commandbutton1 must be disabled. I
> would like to know how create a macro that checks all these specific

cells.
> Should I use select case?
>
> Thanks for helping, Gert-Jan
>
>



 
Reply With Quote
 
Gert-Jan
Guest
Posts: n/a
 
      18th Oct 2006
The situation is like this:

- in the userform are textboxes and comboboxes (total: 6)
- if the user types or selects something (on change), the data will be
written to a sheet (that will happen on 6 places)

I want a macro that will run (also on change of one of texboxes /
comboboxes) and check if the filled in / selected data is proper.

A sort function like this

Sub check()
If range (Sheet1!D5).value = 1 OR
If range (Sheet2!D8).value = 0 OR
etc
CommandButton1.enabled = false

I have never worked with caseselect-functions, any help would be nice ;-)

"Bob Phillips" <(E-Mail Removed)> schreef in bericht
news:%(E-Mail Removed)...
> How will you initiate the checks. Normally it would be clicking a button,
> such as the OK button, then just look at each value and test it. If they
> are
> okay, write them away, else throw up an error message.
>
> Select Case might be a strategy, but there is too little info to advise.
>
> --
> HTH
>
> Bob Phillips
>
> (replace somewhere in email address with gmail if mailing direct)
>
> "Gert-Jan" <(E-Mail Removed)> wrote in message
> news:4535eae1$0$27817$(E-Mail Removed)...
>> I have a userform with some texboxes and comboboxes. If the user types or
>> select something, that data will be written to cells. (Sheet1A1,

> Sheet2B15,
>> Sheet3K29, etc.)
>> That input must be checked before it can be stored in the database. If
>> the
>> cells doesn't contain proper data, the commandbutton1 must be disabled. I
>> would like to know how create a macro that checks all these specific

> cells.
>> Should I use select case?
>>
>> Thanks for helping, Gert-Jan
>>
>>

>
>



 
Reply With Quote
 
Gert-Jan
Guest
Posts: n/a
 
      18th Oct 2006
And, of course: if the values are Ok, CommandButton1.enabled = True

"Gert-Jan" <(E-Mail Removed)> schreef in bericht
news:4535f89f$0$27821$(E-Mail Removed)...
> The situation is like this:
>
> - in the userform are textboxes and comboboxes (total: 6)
> - if the user types or selects something (on change), the data will be
> written to a sheet (that will happen on 6 places)
>
> I want a macro that will run (also on change of one of texboxes /
> comboboxes) and check if the filled in / selected data is proper.
>
> A sort function like this
>
> Sub check()
> If range (Sheet1!D5).value = 1 OR
> If range (Sheet2!D8).value = 0 OR
> etc
> CommandButton1.enabled = false
>
> I have never worked with caseselect-functions, any help would be nice ;-)
>
> "Bob Phillips" <(E-Mail Removed)> schreef in bericht
> news:%(E-Mail Removed)...
>> How will you initiate the checks. Normally it would be clicking a button,
>> such as the OK button, then just look at each value and test it. If they
>> are
>> okay, write them away, else throw up an error message.
>>
>> Select Case might be a strategy, but there is too little info to advise.
>>
>> --
>> HTH
>>
>> Bob Phillips
>>
>> (replace somewhere in email address with gmail if mailing direct)
>>
>> "Gert-Jan" <(E-Mail Removed)> wrote in message
>> news:4535eae1$0$27817$(E-Mail Removed)...
>>> I have a userform with some texboxes and comboboxes. If the user types
>>> or
>>> select something, that data will be written to cells. (Sheet1A1,

>> Sheet2B15,
>>> Sheet3K29, etc.)
>>> That input must be checked before it can be stored in the database. If
>>> the
>>> cells doesn't contain proper data, the commandbutton1 must be disabled.
>>> I
>>> would like to know how create a macro that checks all these specific

>> cells.
>>> Should I use select case?
>>>
>>> Thanks for helping, Gert-Jan
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
RETRIEVE DATA FROM ANOTHER WORKBOOK BY CHECKING ON WORKBOOK DATE Joe Microsoft Excel Worksheet Functions 13 27th May 2008 01:52 AM
How do I call number values form one workbook to another workbook Teryn Microsoft Excel Worksheet Functions 3 29th Dec 2007 09:21 AM
checking values of textbox with table values kelvin H via AccessMonster.com Microsoft Access Form Coding 1 15th Sep 2005 10:49 AM
How do I post values from source workbook to destination workbook =?Utf-8?B?UmFnaGF2ZW5kcmEgS3Vsa2Fybmk=?= Microsoft Excel Programming 1 4th May 2005 01:31 PM
Checking for Open Workbook sbharbour Microsoft Excel Programming 6 28th Aug 2003 11:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 AM.