2 Questions about code with excel 97

  • Thread starter Thread starter Rubicant
  • Start date Start date
R

Rubicant

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
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top