Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
reference format Range(Cells(),Cells())
Hi All,
I wanted to use ThisWorkbook.Worksheets("shname").Range(Cells(2, colNo1), Cells(2, colNo2)).ClearContents but it failed with a runtime error 1004. When I changed the code either to ThisWorkbook.Worksheets("shname").Select Range(Cells(2, colNo1), Cells(2, colNo2)).ClearContents or - having transformed colNo1 to colLetter1 and colNo2 to colLetter2 - to ThisWorkbook.Worksheets("shname").Range(colLetter1 & 2 & ":" & colLetter2 & 2)).ClearContents both version worked. I'd like to know WHY this happens, is it my fault or is it an XL bug? Regards, Stefi |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ComboBox AddItem code to reference cells in a Range | Excel Discussion (Misc queries) | |||
changing absolute reference for range of cells | Excel Worksheet Functions | |||
Range of cells: Convert relative reference into absolute | Excel Discussion (Misc queries) | |||
Formula to return the reference of a range of cells | Excel Discussion (Misc queries) | |||
How do I reference the same cell as I move through range of cells. | Excel Worksheet Functions |