how to restrict user input using macros in Excelladdin

Post Reply
ranga
Posts: 5
Joined: Thu Dec 10, 2015 11:35 am
OLAP Product: COGNOSTM1, Cognos
Version: 10.2.2
Excel Version: 2010

how to restrict user input using macros in Excelladdin

Post by ranga »

HI Team ,

i want restrict user input negative value into excel template using macros .

Please help your inputs
User avatar
jim wood
Site Admin
Posts: 3953
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: how to restrict user input using macros in Excelladdin

Post by jim wood »

Moved to the correct forum.
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
ranga
Posts: 5
Joined: Thu Dec 10, 2015 11:35 am
OLAP Product: COGNOSTM1, Cognos
Version: 10.2.2
Excel Version: 2010

Re: how to restrict user input using macros in Excelladdin

Post by ranga »

Thanks for reply

i am new to this portal . please tell me which group we can keep this post
Wim Gielis
MVP
Posts: 3128
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: how to restrict user input using macros in Excelladdin

Post by Wim Gielis »

This subforum is fine, Jim moved the topic for you.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
RJ!
Community Contributor
Posts: 219
Joined: Mon Jul 23, 2012 8:31 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Re: how to restrict user input using macros in Excelladdin

Post by RJ! »

ranga wrote:HI Team ,
i want restrict user input negative value into excel template using macros .
If I'm reading that right, I think you need to have code against an "On Change" procedure in your Excel Template that monitors the cells your looking at...

Though if it was me, I'd just use Data Validation in Excel to restrict a user from inputting anything "Less then 0" in your form
Wim Gielis
MVP
Posts: 3128
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: how to restrict user input using macros in Excelladdin

Post by Wim Gielis »

The event in VBA is called Worksheet_Change event.
You will find thousands of code samples on the internet with a search action.
However, as said above, there are better ways to tackle this requirement.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
jduplessis
Posts: 19
Joined: Tue Sep 16, 2014 11:51 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010
Location: Ottawa, Canada

Re: how to restrict user input using macros in Excelladdin

Post by jduplessis »

Another alternative is using sell locking and protecting the sheet. We use this a lot because it also works in TM1 web, unlike VBA alternatives.
Wim Gielis
MVP
Posts: 3128
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: how to restrict user input using macros in Excelladdin

Post by Wim Gielis »

jduplessis wrote:Another alternative is using sell locking and protecting the sheet
How does his restrict the input of negative values ?
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
jduplessis
Posts: 19
Joined: Tue Sep 16, 2014 11:51 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010
Location: Ottawa, Canada

Re: how to restrict user input using macros in Excelladdin

Post by jduplessis »

Wim Gielis wrote:
jduplessis wrote:Another alternative is using sell locking and protecting the sheet
How does his restrict the input of negative values ?
Ah, I stopped reading at restrict values... technically I suppose not being able to enter any value would include not being able to enter negative values, but not the intended outcome...
Wim Gielis
MVP
Posts: 3128
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: how to restrict user input using macros in Excelladdin

Post by Wim Gielis »

jduplessis wrote:
Wim Gielis wrote:
jduplessis wrote:Another alternative is using sell locking and protecting the sheet
How does his restrict the input of negative values ?
Ah, I stopped reading at restrict values... technically I suppose not being able to enter any value would include not being able to enter negative values, but not the intended outcome...
Let's give READ access to everyone and we will never ever suffer from bad input :-D
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
ranga
Posts: 5
Joined: Thu Dec 10, 2015 11:35 am
OLAP Product: COGNOSTM1, Cognos
Version: 10.2.2
Excel Version: 2010

Re: how to restrict user input using macros in Excelladdin

Post by ranga »

Thanks all for your reply
Post Reply