Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
formula to sort a range so that it matches the exact rows of a column that is outside that range? | Excel Discussion (Misc queries) | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming | |||
how to? set my range= my UDF argument (range vs. value in range) [advanced?] | Excel Programming |