ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   2 Questions about code with excel 97 (https://www.excelbanter.com/excel-programming/316659-2-questions-about-code-excel-97-a.html)

Rubicant

2 Questions about code with excel 97
 

The first question is the most important:
Why can't I use the following vb function in excel modules:
mid,left,right,chr,space but i can still use instr. Is there anything
must click to enable theses? :confused:


The Second question is simple:
Why can't I rename the modules and they are named module1,module2 etc
No options will allow me as I right click on them to change it. Also i
I use this code it won't work and will tell me that the function i us
is not recognized by excel: activeworkbook.modules("module1").name
"modMain".
I really need theses informations thanks

--
Rubican
-----------------------------------------------------------------------
Rubicant's Profile: http://www.excelforum.com/member.php...fo&userid=1641
View this thread: http://www.excelforum.com/showthread.php?threadid=27789


Jim Thomlinson[_3_]

2 Questions about code with excel 97
 
Question 1
VBA functions and Excel functions are two different things. In Excel you use
Char where as in VBA you use Chr. Just the way it goes...

Question 2
You can rename the modules, sheets... In the View menu select Properties
Window. Beside (Name) you can change the module name. You can also change
sheet names. This is real handy. Change 'Sheet1' to shtMySheet and now you
can refer to it directly in code. This way if someone changes the tab name of
a sheet your code will not crash.

sheets("Tab Name").select

becomes

shtMySheet.select

"Rubicant" wrote:


The first question is the most important:
Why can't I use the following vb function in excel modules:
mid,left,right,chr,space but i can still use instr. Is there anything i
must click to enable theses? :confused:


The Second question is simple:
Why can't I rename the modules and they are named module1,module2 etc.
No options will allow me as I right click on them to change it. Also if
I use this code it won't work and will tell me that the function i use
is not recognized by excel: activeworkbook.modules("module1").name =
"modMain".
I really need theses informations thanks.


--
Rubicant
------------------------------------------------------------------------
Rubicant's Profile: http://www.excelforum.com/member.php...o&userid=16419
View this thread: http://www.excelforum.com/showthread...hreadid=277891



Tom Ogilvy

2 Questions about code with excel 97
 
for you first problem, after it occurs, reset the project, then go into
Tools=References in the VBE and you should see at least one or more entries
Marked as MISSING. You need to clean up these references as they are the
source of the problem.

--
Regards,
Tom Ogilvy

"Rubicant" wrote in message
...

The first question is the most important:
Why can't I use the following vb function in excel modules:
mid,left,right,chr,space but i can still use instr. Is there anything i
must click to enable theses? :confused:


The Second question is simple:
Why can't I rename the modules and they are named module1,module2 etc.
No options will allow me as I right click on them to change it. Also if
I use this code it won't work and will tell me that the function i use
is not recognized by excel: activeworkbook.modules("module1").name =
"modMain".
I really need theses informations thanks.


--
Rubicant
------------------------------------------------------------------------
Rubicant's Profile:

http://www.excelforum.com/member.php...o&userid=16419
View this thread: http://www.excelforum.com/showthread...hreadid=277891





All times are GMT +1. The time now is 09:52 AM.

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