but i can't see the VBA code in the attached file.
?
Main Topics
Browse All Topicsthis is a continuation of my prior question:
http://www.experts-exchang
1. if i want to choose a bigger number, what should i do ?
ie. if 0.75 and 1.25 , they are both 0.25 away from 1.
but i would like to choose the bigger number instead. ie. 1.25.
2. and once 1.25 is chosen , the result will show 1.25 and then inserted a column beside "Result"
and it shows the column header of where 1.25 is from.
for eg. the column title of 1.25 is BOX1. so it should show:
1.25 BOX1
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
ceneiqe,
If the file is Saved As with a new name then the macro in the original file will also be in the new file. The file name is not used in the macro so you can call the file anything you like!
If you create a totally new file and want the macro in it then this is what you need to do to install the macro in a module:
1) Press ALT+F11
2) Find the workbook name in the VBAProject window (CTRL+R if it's not visible), right-click on the file name
3) Select Insert/Module
4) Double click on the new Module
5) Paste the code into the Module under Option Explicit
6) ALT + F11 to return to the worksheet
7) Save the file
8) ALT + F8 to select and run the macro
Hope that helps
Patrick
aikimark:
This is the code and i place them in module1.
But i encounter the following error :
Macros are disabled because the security level is set to high and a digitally signed trusted certificate is not attached to the macros. to run the macros, change the security level to a lower setting (not recommended), or request the macros be signed by the author using a certificate issued by a certificate authority.
what has gone wrong ?
ceneiqe,
By the way you were asking aikimark about the code that I wrote!
You will need to set the Security leve to Medium to run my macro. It is possible that the first time you reset the Security level you will need to set it to Low, but as soon as you have run a macro you can then change it to Medium.
Patrick
ceneiqe,
I have now completely lost the plot on this question. I now no longer understand what you are wanting. As I understand it, you specify a number and then want to extract from a small range of numbers the value that is the next smallest from the specified number.
So taking your original question example:
0.5, 1.5, 2.1, 0.43, 0.35
your condition number : 1
So from that you want the next number from the range that is smaller than 1. The answer from that range of numbers would be 0.5
If your 'condition number' had been 0.43 then the answer would have been 0.35
And yet it appears you have now changed your requirements. Do please re-state what it is that you are wanting. It is not good enough to say 'I doesn't work' when it does work but now apparently doesn't give you the answers you are wanting. So please explain your requirement again...
Patrick
the condition is already taken care of. (see sheet 1 script)
ie. example given :
0.5, 1.5, 2.1, 0.43, 0.35
the result should be 1.5. (0.5 is also 0.5 near to 1 as to 1.5 is 0.5 to 1 - but we choose the larger number, thus 1.5)
example 2:
2.5, 0.2, 1.3, 0.6, 0.9
result = 0.9
yes, the condition number = 1
the result chosen must be nearest to 1.
now what i need is just the macro - to have the results in column AI and AJ.
(see Module1 script)
thanks.
compare-test-05 is ok (good initiative for bold) except that :
column AJ is not supposed to be already inserted.
It should be inserted after the macro is run.
the headers from Column AA to AH is the same as Column M to T.
so Column AK will show the corresponding information (chosen from M to T depending on the result in Column AI ) when the column AJ points to the headerXX.
Thus column AJ to AN should be inserted after the macro is run.
(see attached for details)
------------------------
to insert:
Column AL to AN
after running the macro
condition number is 2 instead of 1.
and then the corresponding results follow.
--------
Note: I have increased the points to 150 as i know i have required additional parts (Result2) which is not stated in the beginning to be fair.
>column AJ is not supposed to be already inserted.
>It should be inserted after the macro is run.
I needs to be inserted by the macro before the results are placed in that column. I have changed the macro to do that - it's in the attached file.
I'm afraid that's as far as I can go. I don't understand your other requirements and I am about to travel for a week so it might be best to close this question.
initially the result is based on condition number = 1 (see code below)
ie. if 0.75 and 1.25 , they are both 0.25 away from 1.
but i would like to choose the bigger number instead. ie. 1.25.
But if the condition number =2
ie. the numbers must be nearest to 2.
example in row 2:
6.27 1.50 0.50 0.90 0.20 1.10 0.00 0.00
instead of choosing 0.90, the result is now 1.5.
So i am having 2 sets of results, ie. one for Condition number =1 and then Condition number =2.
Yes, i understand, no worries, i will close both result1 and 2 is settled.
I don't like to drag either.
Anyway i have already increased the points and so i can't revert back.
It would be good if you could also show the results (side by side ) for each threshold number that i put in.
ie. Result1 Header1 Result2 Header2
Maybe can add an inbox when i indicate a threhold the second time ,
"Do you wish to show previous threhold result?"
Type in Y or N
if one type Y - then the result2 header2 will appear after Result1 header1
else it will remain as result1 header1
so on......
but of course, this solution still fulfill except that one has to copy the results somewhere else if he has to compare the results of different threshold.
hi aikimark, glad you understand.
You might be interested in another question:
http://www.experts-exchang
Thanks !
ceneiqe,
>It would be good if you could also show the results (side by side ) for each >threshold number that i put in.
>ie. Result1 Header1 Result2 Header2
>Maybe can add an inbox when i indicate a threhold the second time ,
>"Do you wish to show previous threhold result?"
>Type in Y or N - if one type Y - then the result2 header2 will appear after >Result1 header1
>else it will remain as result1 header1
>so on......
>but of course, this solution still fulfill except that one has to copy the results >somewhere else if he has to compare the results of different threshold.
All easily done and I am sure it would be good, but as you have awarded a B grade I have no intention of spending any more time on this question.
Patrick
Business Accounts
Answer for Membership
by: patrickabPosted on 2009-06-23 at 03:11:20ID: 24690436
ceneiqe,
3,0)+1,1)
You could use this:
=INDEX(A1:A3,MATCH(C2,A1:A
It's in the attached file.
Patrick
Excel