Hallo,
I'm using this code to refer to a range of cells in an excel sheet from Access:
where Sht is:
and uRow is an integer variable
I also tried to use this:
but without success...
it is strange because if I use the same sintax within a "WITH/END WITH" sentence it does work:
Any ideas? thanks
I'm using this code to refer to a range of cells in an excel sheet from Access:
Code:
Sht.Range(Cells(1, 1), Cells(uRow - 1, 1)).Interior.ColorIndex = "6"
where Sht is:
Code:
Set Sht = xlApp.ActiveWorkbook.Sheets(2)
and uRow is an integer variable
I also tried to use this:
Code:
Sht.Range(.Cells(1, 1), .Cells(uRow - 1, 1)).Interior.ColorIndex = "6"
but without success...
it is strange because if I use the same sintax within a "WITH/END WITH" sentence it does work:
Code:
With Sht
.Range(.Cells(1, 1), .Cells(uRow - 1, 1)).Interior.ColorIndex = "6"
End With
Any ideas? thanks