Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default VBA editor replaces 'Range' with 'range'

In several Modules or Class Modules if I add a new line
"Dim r As Range",
the 'R' changes to 'r' when I press Enter.

Auto Syntax Check is not enabled.

I can't think of any changes I've made to the IDE
that could cause this.

Thanks for your help,
Peter.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA editor replaces 'Range' with 'range'

I was able to replicate your problem by creating a variable with the name
"range" and declaring it as type "Range" - i.e. "Dim range As Range". I also
experimented with making it public - i.e. "Public range As Range". I don't
know if making it public was necessary. I don't think so.

Having done this, I can't make the problem go away either. I tried:
1) Deleting all the modules and recreating
2) Rebooting
3) Declaring a variable as "Range" publicly, with the Dim statement in a
class module as well as at module level in a standard module and at procedure
level in a standard module.
4) Unselecting Auto Syntax Check and other options

None of the above worked - i.e. the capital "R" always changes to lower case
"r". I guess it's a bug.

I did find that it is workbook specific. Also note that variables so
declared still seem to be recognized as of "Range" data type because an error
is generated if you don't use the Set statement.

Couldn't find a solution but I believe I found the cause. Hope this was of
some help.

Regards,
Greg


"peter" wrote:

In several Modules or Class Modules if I add a new line
"Dim r As Range",
the 'R' changes to 'r' when I press Enter.

Auto Syntax Check is not enabled.

I can't think of any changes I've made to the IDE
that could cause this.

Thanks for your help,
Peter.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA editor replaces 'Range' with 'range'

Peter,
What happens if you type:
Dim r As Excel.range

NickHK

"peter" wrote in message
...
In several Modules or Class Modules if I add a new line
"Dim r As Range",
the 'R' changes to 'r' when I press Enter.

Auto Syntax Check is not enabled.

I can't think of any changes I've made to the IDE
that could cause this.

Thanks for your help,
Peter.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default VBA editor replaces 'Range' with 'range'

I tried that in my experiments also but forgot to mention it. "Excel.Range"
becomes "Excel.range" and if you type "Excel.range" it is accepted unchanged.

Regards,
Greg

"NickHK" wrote:

Peter,
What happens if you type:
Dim r As Excel.range

NickHK

"peter" wrote in message
...
In several Modules or Class Modules if I add a new line
"Dim r As Range",
the 'R' changes to 'r' when I press Enter.

Auto Syntax Check is not enabled.

I can't think of any changes I've made to the IDE
that could cause this.

Thanks for your help,
Peter.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default VBA editor replaces 'Range' with 'range'

UPDATE

What prob. caused it was that I defined the name of a Property
method to be 'range'.

I've removed that and changed every other 'range' and there's
no sign of any in the Locals page.

But I've still got the problem, even after restarting VBA.

I didn't specifically say, but it's changed ALL my Ranges!

I sure hope someone can help, as I'm dead in the water
like this.

ciao,
Peter




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA editor replaces 'Range' with 'range'

Greg,
Check the references and their order for the workbook. Any marked as missing
?
After typing "Excel." (with the full stop), what do you see ?

NickHK

"Greg Wilson" wrote in message
...
I tried that in my experiments also but forgot to mention it.

"Excel.Range"
becomes "Excel.range" and if you type "Excel.range" it is accepted

unchanged.

Regards,
Greg

"NickHK" wrote:

Peter,
What happens if you type:
Dim r As Excel.range

NickHK

"peter" wrote in message
...
In several Modules or Class Modules if I add a new line
"Dim r As Range",
the 'R' changes to 'r' when I press Enter.

Auto Syntax Check is not enabled.

I can't think of any changes I've made to the IDE
that could cause this.

Thanks for your help,
Peter.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default VBA editor replaces 'Range' with 'range'

None are listed as missing. When I type either "Excel." or "Dim abc As
Excel." the AutoList Members list appears. "Range" is included in the list.
When I select this, after it is automatically inserted, it then changes to
"range".

Regards,
Greg

"NickHK" wrote:

Greg,
Check the references and their order for the workbook. Any marked as missing
?
After typing "Excel." (with the full stop), what do you see ?

NickHK

"Greg Wilson" wrote in message
...
I tried that in my experiments also but forgot to mention it.

"Excel.Range"
becomes "Excel.range" and if you type "Excel.range" it is accepted

unchanged.

Regards,
Greg

"NickHK" wrote:

Peter,
What happens if you type:
Dim r As Excel.range

NickHK

"peter" wrote in message
...
In several Modules or Class Modules if I add a new line
"Dim r As Range",
the 'R' changes to 'r' when I press Enter.

Auto Syntax Check is not enabled.

I can't think of any changes I've made to the IDE
that could cause this.

Thanks for your help,
Peter.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default VBA editor replaces 'Range' with 'range'

Peter

All you need to do is create a variable with the capitalization you want.
Then delete it.

Dim Range

the delete it. Now

Dim x As Range

will be capitalized how you expect.

When you create a variable (or property, in your case) that is a keyword,
VBA remembers the capitalization even after you delete the
variable/property. This just tricks into doing it right.


--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com



peter wrote:
UPDATE

What prob. caused it was that I defined the name of a Property
method to be 'range'.

I've removed that and changed every other 'range' and there's
no sign of any in the Locals page.

But I've still got the problem, even after restarting VBA.

I didn't specifically say, but it's changed ALL my Ranges!

I sure hope someone can help, as I'm dead in the water
like this.

ciao,
Peter




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default VBA editor replaces 'Range' with 'range'

That's great, thanks Dick.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
Range.Find returns cell outside of range when range set to single cell Frank Jones Excel Programming 12 June 10th 04 04:22 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"