how to call? is it not run automatically when enter 1M & enter?

Aamir Shahzad

On Sat, Oct 29, 2011 at 2:52 AM, Sam Mathai Chacko <samde...@gmail.com>wrote:

> The original code that I gave should have been written within a workbook.
> But now that you are using an add-in, yes you can use it in a different
> module, but for it to run, you will have to CALL it when required.
>
> Sam
>
>
> On Sat, Oct 29, 2011 at 3:20 AM, Aamir Shahzad 
> <aamirshahza...@gmail.com>wrote:
>
>> Can I create another "Module 2" in the same add in & write code there?
>>
>> Aamir Shahzad
>>
>> On Sat, Oct 29, 2011 at 2:43 AM, Sam Mathai Chacko <samde...@gmail.com>wrote:
>>
>>> Not sure what procedure you require, but if you knew the range, this is
>>> how you'd call this
>>>
>>> ---- your code ------
>>> ---- your code ------
>>> Call ConvertToMillions(Worksheets("NameOfSheet").Range("A1"))
>>> ---- your code ------
>>>
>>> Private Sub ConvertToMillions(ByRef Target As Range)
>>>
>>>
>>>     Dim rngCell As Range
>>>
>>>     For Each rngCell In Target
>>>         If Right(UCase(Trim(rngCell.Text)), 1) = "M" Then
>>>             rngCell.Value = Replace(UCase(Trim(rngCell.Text)), "M", "") *
>>> 10 ^ 6
>>>         End If
>>>     Next
>>>
>>> End Sub
>>>
>>> Sam Mathai Chacko (GL)
>>>
>>>
>>> On Sat, Oct 29, 2011 at 3:10 AM, Aamir Shahzad <aamirshahza...@gmail.com
>>> > wrote:
>>>
>>>> how? procedure required.
>>>>
>>>>
>>>> On Sat, Oct 29, 2011 at 2:39 AM, Sam Mathai Chacko 
>>>> <samde...@gmail.com>wrote:
>>>>
>>>>> Yes you can
>>>>> Sam
>>>>>
>>>>>
>>>>> On Sat, Oct 29, 2011 at 3:07 AM, Aamir Shahzad <
>>>>> aamirshahza...@gmail.com> wrote:
>>>>>
>>>>>> Can I enter this code with another add in?
>>>>>>
>>>>>>
>>>>>> On Sat, Oct 29, 2011 at 2:27 AM, Sam Mathai Chacko <
>>>>>> samde...@gmail.com> wrote:
>>>>>>
>>>>>>> Something like this might do the trick
>>>>>>>
>>>>>>> Private Sub Worksheet_Change(ByVal Target As Range)
>>>>>>>
>>>>>>>     Dim rngCell As Range
>>>>>>>
>>>>>>>     For Each rngCell In Target
>>>>>>>         If Right(UCase(Trim(rngCell.Text)), 1) = "M" Then
>>>>>>>             rngCell.Value = Replace(UCase(Trim(rngCell.Text)), "M",
>>>>>>> "") * 10 ^ 6
>>>>>>>         End If
>>>>>>>     Next
>>>>>>>
>>>>>>> End Sub
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Sam Mathai Chacko (GL)
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Oct 29, 2011 at 2:52 AM, Aamir Shahzad <
>>>>>>> aamirshahza...@gmail.com> wrote:
>>>>>>>
>>>>>>>> Dear Experts,
>>>>>>>>
>>>>>>>> Is it possible in excel that if I write in cell "1M" & press tab or
>>>>>>>> enter it automatically converted this figure to 1,000,000. or 4.5M to
>>>>>>>> 4,500,000.
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Aamir Shahzad
>>>>>>>>
>>>>>>>> --
>>>>>>>> FORUM RULES (925+ members already BANNED for violation)
>>>>>>>>
>>>>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like
>>>>>>>> Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need
>>>>>>>> Advice will not get quick attention or may not be answered.
>>>>>>>>
>>>>>>>> 2) Don't post a question in the thread of another member.
>>>>>>>>
>>>>>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>>>>>> measure.
>>>>>>>>
>>>>>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>>>>>
>>>>>>>> 5) Cross-promotion of, or links to, forums competitive to this forum
>>>>>>>> in signatures are prohibited.
>>>>>>>>
>>>>>>>> NOTE : Don't ever post personal or confidential data in a workbook.
>>>>>>>> Forum owners and members are not responsible for any loss.
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------------------------------
>>>>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Sam Mathai Chacko
>>>>>>>
>>>>>>> --
>>>>>>> FORUM RULES (925+ members already BANNED for violation)
>>>>>>>
>>>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like
>>>>>>> Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need
>>>>>>> Advice will not get quick attention or may not be answered.
>>>>>>>
>>>>>>> 2) Don't post a question in the thread of another member.
>>>>>>>
>>>>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>>>>> measure.
>>>>>>>
>>>>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>>>>
>>>>>>> 5) Cross-promotion of, or links to, forums competitive to this forum
>>>>>>> in signatures are prohibited.
>>>>>>>
>>>>>>> NOTE : Don't ever post personal or confidential data in a workbook.
>>>>>>> Forum owners and members are not responsible for any loss.
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------------------------------
>>>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Aamir Shahzad
>>>>>>
>>>>>> --
>>>>>> FORUM RULES (925+ members already BANNED for violation)
>>>>>>
>>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like
>>>>>> Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need
>>>>>> Advice will not get quick attention or may not be answered.
>>>>>>
>>>>>> 2) Don't post a question in the thread of another member.
>>>>>>
>>>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>>>> measure.
>>>>>>
>>>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>>>
>>>>>> 5) Cross-promotion of, or links to, forums competitive to this forum
>>>>>> in signatures are prohibited.
>>>>>>
>>>>>> NOTE : Don't ever post personal or confidential data in a workbook.
>>>>>> Forum owners and members are not responsible for any loss.
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------------------------------
>>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sam Mathai Chacko
>>>>> --
>>>>> FORUM RULES (925+ members already BANNED for violation)
>>>>>
>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice 
>>>>> will
>>>>> not get quick attention or may not be answered.
>>>>>
>>>>> 2) Don't post a question in the thread of another member.
>>>>>
>>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>>> measure.
>>>>>
>>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>>
>>>>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>>>>> signatures are prohibited.
>>>>>
>>>>> NOTE : Don't ever post personal or confidential data in a workbook.
>>>>> Forum owners and members are not responsible for any loss.
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------------------------------
>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Regards,
>>>>
>>>> Aamir Shahzad
>>>>
>>>> --
>>>> FORUM RULES (925+ members already BANNED for violation)
>>>>
>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice 
>>>> will
>>>> not get quick attention or may not be answered.
>>>>
>>>> 2) Don't post a question in the thread of another member.
>>>>
>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>> measure.
>>>>
>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>
>>>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>>>> signatures are prohibited.
>>>>
>>>> NOTE : Don't ever post personal or confidential data in a workbook.
>>>> Forum owners and members are not responsible for any loss.
>>>>
>>>>
>>>> ------------------------------------------------------------------------------------------------------
>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>
>>>
>>>
>>>
>>> --
>>> Sam Mathai Chacko
>>> --
>>> FORUM RULES (925+ members already BANNED for violation)
>>>
>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
>>> not get quick attention or may not be answered.
>>>
>>> 2) Don't post a question in the thread of another member.
>>>
>>> 3) Don't post questions regarding breaking or bypassing any security
>>> measure.
>>>
>>> 4) Acknowledge the responses you receive, good or bad.
>>>
>>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>>> signatures are prohibited.
>>>
>>> NOTE : Don't ever post personal or confidential data in a workbook. Forum
>>> owners and members are not responsible for any loss.
>>>
>>>
>>> ------------------------------------------------------------------------------------------------------
>>> To post to this group, send email to excel-macros@googlegroups.com
>>>
>>
>>
>>
>> --
>>
>> Regards,
>>
>> Aamir Shahzad
>>
>> --
>> FORUM RULES (925+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
>> not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>
>> NOTE : Don't ever post personal or confidential data in a workbook. Forum
>> owners and members are not responsible for any loss.
>>
>>
>> ------------------------------------------------------------------------------------------------------
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>
>
>
> --
> Sam Mathai Chacko
> --
> FORUM RULES (925+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
> not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>



-- 

Regards,

Aamir Shahzad

-- 
FORUM RULES (925+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to