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

Hi,

I am new to programming and I would like to know how to
do some automation in MS-Excel.

For example in Column A I would type some questions for
which user need to answer in column B for each question.
When they answer a question and leaves the cell I should
be able to evaluate whether the answer is true or false
and display the same in Column C.

When user open the excel file user will be seeing only
question in column A, when he types in answer in Column B,
it has to evaluated and result has to be displayed in
column C
A B C
No. of Months in a Year 12 true
No. of weeks in a Year 2 false

Could someone help me out with an example or links to
help me know how to achieve this kind of requirement
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Excel programming

Hi Surya,
What you want to achieve is not really difficult to do with some VBA coding.
But until you've some sort grasp of the excel object model and VBA, codes
from others will only perplex you. If you're just starting out, I'd
recommend you to go through some tutorials. This page has got links for
everyone: http://www.mvps.org/dmcritchie/excel/excel.htm

If you already know the basics, then ignore this post. someone will come
along with the code.

Good luck.
~Asif

Surya wrote in message ...
Hi,

I am new to programming and I would like to know how to
do some automation in MS-Excel.

For example in Column A I would type some questions for
which user need to answer in column B for each question.
When they answer a question and leaves the cell I should
be able to evaluate whether the answer is true or false
and display the same in Column C.

When user open the excel file user will be seeing only
question in column A, when he types in answer in Column B,
it has to evaluated and result has to be displayed in
column C
A B C
No. of Months in a Year 12 true
No. of weeks in a Year 2 false

Could someone help me out with an example or links to
help me know how to achieve this kind of requirement



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel programming

You can do this with a formula in column C

For example, in C2

=if(B2="","",if(B2=12,True,False))

You can also shorten it to
=if(B2="","",if(B2=12,True))

--
Regards,
Tom Ogilvy


"Surya" wrote in message
...
Hi,

I am new to programming and I would like to know how to
do some automation in MS-Excel.

For example in Column A I would type some questions for
which user need to answer in column B for each question.
When they answer a question and leaves the cell I should
be able to evaluate whether the answer is true or false
and display the same in Column C.

When user open the excel file user will be seeing only
question in column A, when he types in answer in Column B,
it has to evaluated and result has to be displayed in
column C
A B C
No. of Months in a Year 12 true
No. of weeks in a Year 2 false

Could someone help me out with an example or links to
help me know how to achieve this kind of requirement



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Excel programming

Or even

=if(B2="","",B2=12)

--
Best Regards
Leo Heuser
Excel MVP

Followup to newsgroup only please.

"Tom Ogilvy" skrev i en meddelelse
...
You can do this with a formula in column C

For example, in C2

=if(B2="","",if(B2=12,True,False))

You can also shorten it to
=if(B2="","",if(B2=12,True))

--
Regards,
Tom Ogilvy





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Excel programming

Hello Surya,

This can be done even without VB.

First, write a formula in C that will evaluate if the answer is correct.
Assume that question and answer are in A1 and B1 respectively then write the
formula in C1 as =IF(B1="","",B1=12). If the correct answer is not number,
you must enclose it in quotation marks. i.e =IF(B1="","",B1="ABC").

Second, protect your worksheet. Select all the cells that user will use to
put their answers. In FormatCellsProtection Tab uncheck "locked". Now
select all the cells that you have put your formula. In
FormatCellsProtection Tab check "hidden" to prevent them in seeing the
correct answers. Perhaps, you already know that you need to go
ToolsProtectionProtect Sheet because if you have notice this is noted in
Format Cells Dialog box.

If you still wish to use VB, sad to say I am only one of the ordinary guy.
But, if you just wait a while experts in this NG could help you.

Regards,

Jon-jon

"Surya" wrote in message
...
Hi,

I am new to programming and I would like to know how to
do some automation in MS-Excel.

For example in Column A I would type some questions for
which user need to answer in column B for each question.
When they answer a question and leaves the cell I should
be able to evaluate whether the answer is true or false
and display the same in Column C.

When user open the excel file user will be seeing only
question in column A, when he types in answer in Column B,
it has to evaluated and result has to be displayed in
column C
A B C
No. of Months in a Year 12 true
No. of weeks in a Year 2 false

Could someone help me out with an example or links to
help me know how to achieve this kind of requirement




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
Excel Programming danjordan2000 Excel Discussion (Misc queries) 1 November 17th 08 01:20 PM
Excel Programming [email protected] Excel Worksheet Functions 0 April 14th 06 07:13 AM
Excel programming using VBA Dave Peterson[_3_] Excel Programming 1 October 8th 03 02:39 AM
how to programming Excel in C# Weimin Zhang Excel Programming 0 October 6th 03 03:29 PM
Excel Programming in VB Peter Atherton Excel Programming 2 September 9th 03 12:40 PM


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

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

About Us

"It's about Microsoft Excel"