Question:
Excel error on Office 2003?
anonymous
2006-12-21 10:06:50 UTC
This line of code causes an error in excel Office 2003 but not in 2000. I see nothing wrong witj this. Anyone know why it is an error?

Range("I12:I14").Font.ColorIndex = Range("AD5").Offset([Y15], 2)
Four answers:
anonymous
2006-12-21 10:18:57 UTC
offset(row,column) you can't put a range object in it.



besides We can't see your code in full. To avoid this add some spaces before and after the ()

add some comments
Richard H
2006-12-21 11:00:11 UTC
The easy way to figure out where the error is coming from is to lookup the syntax for the command in the version giving you the error. Sometimes the syntax changes when the language is revised.
anonymous
2006-12-24 01:43:36 UTC
1- Why there is [Y15] in Offset?

if you want the value of the cell Y15, then use

Range( "AD5").Offset( Range( "Y15").Value, 2)

Because Offset requires numeric values

2- ColorIndex is also a numeric value, i would rather you to add .Value to the Range in the right side of the line

3- If Y15 is a variable you are using, then why the square brakets?



mail me any further questions



Enjoy my profile, I am the VBAXLMan
?
2016-12-01 06:28:20 UTC
i have experienced similar problems with MS get admission to (from MS get admission to 2000 to MS get admission to 2003 and 2007) I had a database that performed automatic initiatives, good from establishing factor, and when I migrated to more recent variations it began to coach mistakes messages. the basically way i ought to take care of replaced into to remodel the database to the more recent version. do not understand if this would help you with your Excel difficulty...


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...