How to create a macro

Closed
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
Hello,

i am completely new to the task of creating macros.can you please tell me how should i create a macro so that all the cells under a particular column should be able to take only integer values..its urgent..

1 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
804
you do not need a macro
suppose the relevant column is column A
highlight A1
click data(menu)-validation
in the validation window
choosing settings at the top
under allow choose custom
under formula type this
=MOD(A1,1)=0
choose <error alert>
under <error messge> type something like this
This is not an integer
click ok


now copy A1 down upto A10.

now in any of the cells type 2.5 see what happens.

for further study see this web page
https://www.contextures.com/xldataval01.html