ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA macro Trignometry function (https://www.excelbanter.com/excel-programming/446607-vba-macro-trignometry-function.html)

Spint

VBA macro Trignometry function
 
Hi,
I am very much new to VBA programming, started just two days ago.
i need to write a code which uses cos and sin functions.
i tried using Sin and Cos functions.

but i have got a strange problem, that when ever i type Cos in VBA editor , as soon as i hit enter Cos is changing to COS.

I actually tried to create a function named COS and call Cos from that Initially,
But i deleted, since then whenever i type Cos it is changing to COS.

Please help how to solve this problem.

Thanks in Advance.

joeu2004[_2_]

VBA macro Trignometry function
 
"Spint" wrote:
when ever i type Cos in VBA editor , as soon as i hit
enter Cos is changing to COS.
I actually tried to create a function named COS [...].
But i deleted, since then whenever i type Cos it is
changing to COS.


Right, that was my experience when I tested this. Simply creating any
variable named COS, then deleting it causes VBA to remember that Cos was
once written COS. And AFAIK, nothing will change that except....

Replace COS with myCos (any capitalization will do) throughout the module,
export it, and remove it. Then save and close the workbook.

Reopen the workbook, import the module, and replace myCos with Cos. Save
the workbook.

Note: I tried this with only one module. You might need to experiment
further if you have multiple modules. Worst-case scenario: you might need
to export and remove every module.


Spint

Quote:

Originally Posted by joeu2004[_2_] (Post 1603820)
"Spint" wrote:
when ever i type Cos in VBA editor , as soon as i hit
enter Cos is changing to COS.
I actually tried to create a function named COS [...].
But i deleted, since then whenever i type Cos it is
changing to COS.


Right, that was my experience when I tested this. Simply creating any
variable named COS, then deleting it causes VBA to remember that Cos was
once written COS. And AFAIK, nothing will change that except....

Replace COS with myCos (any capitalization will do) throughout the module,
export it, and remove it. Then save and close the workbook.

Reopen the workbook, import the module, and replace myCos with Cos. Save
the workbook.

Note: I tried this with only one module. You might need to experiment
further if you have multiple modules. Worst-case scenario: you might need
to export and remove every module.

Thank you joeu2004 for your suggestion.

I actually removed all the modules and copied the code.
i was having very less modules, so less pain.


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com