ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compile error: Variable not defined (https://www.excelbanter.com/excel-programming/419758-compile-error-variable-not-defined.html)

Hennie Neuhoff

Compile error: Variable not defined
 

On running this code I SOMETIMES get the message
Compile error: Variable not defined - and the "xlNone" is highlighted
Set EersteSel = Range("A4")
Set LaasteSel = EersteSel.End(xlDown).Offset(0, 70)
Set DataSelle = Range(EersteSel, LaasteSel)
DataSelle.Select
DataSelle.EntireRow.Interior.ColorIndex = xlNone

I'm puzzeled - why only sometimes and surely "xlNone" should't be defined ??
Any ideas
Tanks in advance

HJN

Dave Peterson

Compile error: Variable not defined
 
I'm guessing that you may have used x1none (x-one-none), not xlnone
(x-ell-none).



Hennie Neuhoff wrote:

On running this code I SOMETIMES get the message
Compile error: Variable not defined - and the "xlNone" is highlighted
Set EersteSel = Range("A4")
Set LaasteSel = EersteSel.End(xlDown).Offset(0, 70)
Set DataSelle = Range(EersteSel, LaasteSel)
DataSelle.Select
DataSelle.EntireRow.Interior.ColorIndex = xlNone

I'm puzzeled - why only sometimes and surely "xlNone" should't be defined ??
Any ideas
Tanks in advance

HJN


--

Dave Peterson

JLGWhiz

Compile error: Variable not defined
 
Don't know the answer to the compile error, but you do not need
the line: DataSelle.Select . Unless you just want to
see it highlighted, the code is not needed.

"Hennie Neuhoff" wrote:


On running this code I SOMETIMES get the message
Compile error: Variable not defined - and the "xlNone" is highlighted
Set EersteSel = Range("A4")
Set LaasteSel = EersteSel.End(xlDown).Offset(0, 70)
Set DataSelle = Range(EersteSel, LaasteSel)
DataSelle.Select
DataSelle.EntireRow.Interior.ColorIndex = xlNone

I'm puzzeled - why only sometimes and surely "xlNone" should't be defined ??
Any ideas
Tanks in advance

HJN



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

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