Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
What wrong with this. It create error. How can I improve to get rid the
error? Set RN = Range(Cells(2, 1), Cells(r, 1)) Thanks Daniel |
#2
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
Hi Daniel,
Too much missing information - has r been declared and what data type is it and what value does it have. What property of the range are you trying to store in the variable RN? What type of variable is RN and has it been declared. -- Thanks, Shane Devenshire "Daniel" wrote: What wrong with this. It create error. How can I improve to get rid the error? Set RN = Range(Cells(2, 1), Cells(r, 1)) Thanks Daniel |
#3
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
Make sure variables are declared and defined, and make sure you reference
potentially indeterminate ranges. Dim RN As Range Dim wks As Worksheet Dim r As Long Set wks = ActiveWorkbook.Worksheets("My Sheet") r = 100 Set RN = wks.Range(wks.Cells(2,1), wks.Cells(r, 1)) - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Daniel" wrote in message ... What wrong with this. It create error. How can I improve to get rid the error? Set RN = Range(Cells(2, 1), Cells(r, 1)) Thanks Daniel |
#4
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
Hi,
The reason Jon and I are pointing these issues out is that your single line of code is fine. The reason it fails is something else is wrong and Jon and I can't see your code so we are just suggesting the most likely places. Fact is, code that fails on a particular line can fail despite the fact that the line is correct. -- Thanks, Shane Devenshire "Jon Peltier" wrote: Make sure variables are declared and defined, and make sure you reference potentially indeterminate ranges. Dim RN As Range Dim wks As Worksheet Dim r As Long Set wks = ActiveWorkbook.Worksheets("My Sheet") r = 100 Set RN = wks.Range(wks.Cells(2,1), wks.Cells(r, 1)) - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Daniel" wrote in message ... What wrong with this. It create error. How can I improve to get rid the error? Set RN = Range(Cells(2, 1), Cells(r, 1)) Thanks Daniel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to compute a range of cells based on another range of cells? | Excel Worksheet Functions | |||
how to compute a range of cells based on another range of cells? | Excel Worksheet Functions | |||
How to use macros to copy a range of cells which can exclude some cells which I didn't want to be copied? | Excel Worksheet Functions | |||
How do you sum a range of more than 30 cells. I get error each time I try. | Excel Worksheet Functions | |||
sum a range of cells that include an error | Excel Discussion (Misc queries) |