rhombus4
Well-known Member
- Joined
- May 26, 2010
- Messages
- 586
- Office Version
- 365
- 2016
- Platform
- Windows
In the below lines the first 6 and the 11th work, but lines 7, 8, 9 and 10 don't work
Do you have to use Sheets when using ThisWorkbook
[myrange] = "Yes"
[myrange].Offset(0, 1) = "Yes"
Sheets("Sheet1").[myrange].Offset(0, 2) = "Yes"
Range("myrange").Offset(1, 1) = "Yes"
Sheets("Sheet1").Range("myrange").Offset(1, 2) = "Yes"
ThisWorkbook.Sheets("Sheet1").Range("myrange").Offset(1, 3) = "Yes"
ThisWorkbook.Range("A5").Offset(0, 1) = "Yes" 'Compile Error : Method or data member not found
ThisWorkbook.Range("myrange").Offset(4, 1) = "Yes" 'Compile Error : Method or data member not found
ThisWorkbook Range("myrange").Offset(4, 1) = "Yes" 'Compile Error : Invalid use of property
ThisWorkbook.[myrange].Offset(4, 1) = "Yes" 'Compile Error : Method or data member not found
ThisWorkbook.Sheets("Sheet1").[myrange].Offset(4, 1) = "Yes"
Do you have to use Sheets when using ThisWorkbook
[myrange] = "Yes"
[myrange].Offset(0, 1) = "Yes"
Sheets("Sheet1").[myrange].Offset(0, 2) = "Yes"
Range("myrange").Offset(1, 1) = "Yes"
Sheets("Sheet1").Range("myrange").Offset(1, 2) = "Yes"
ThisWorkbook.Sheets("Sheet1").Range("myrange").Offset(1, 3) = "Yes"
ThisWorkbook.Range("A5").Offset(0, 1) = "Yes" 'Compile Error : Method or data member not found
ThisWorkbook.Range("myrange").Offset(4, 1) = "Yes" 'Compile Error : Method or data member not found
ThisWorkbook Range("myrange").Offset(4, 1) = "Yes" 'Compile Error : Invalid use of property
ThisWorkbook.[myrange].Offset(4, 1) = "Yes" 'Compile Error : Method or data member not found
ThisWorkbook.Sheets("Sheet1").[myrange].Offset(4, 1) = "Yes"