Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What am I doing wrong
Sub error()
Dim RowNumber As Double Dim SecondDig As Double RowNumber = Range("E386").Value 'Read RowNumber # RowNumber = RowNumber - 4096 'Shift the RowNumber value Range("H386").Value = RowNumber 'Print to make sure it worked SecondDig = Range(RowNumber, 3).Value ' I get an error here ' using RowNumber as the row value Range("I386").Value = SecondDig End Sub I get an error message on line 7. I am using a variable as the roe number. What am I doing wrong? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What am I doing wrong
Need to know what the rownumber is that you are trying to address. You
subtracted 4096 from it. Are you sure that you did not finish up with a negative number so that you are trying to address a row off the top of the sheet. Check what value you have in cell H386 where you save rownumber. Regard, OssieMac "Fan924" wrote: Sub error() Dim RowNumber As Double Dim SecondDig As Double RowNumber = Range("E386").Value 'Read RowNumber # RowNumber = RowNumber - 4096 'Shift the RowNumber value Range("H386").Value = RowNumber 'Print to make sure it worked SecondDig = Range(RowNumber, 3).Value ' I get an error here ' using RowNumber as the row value Range("I386").Value = SecondDig End Sub I get an error message on line 7. I am using a variable as the roe number. What am I doing wrong? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
What am I doing wrong
Hi again,
The light just come on. Your syntax is wrong. try this:- SecondDig = Cells(rownumber, 3).Value Regards, OssieMac "OssieMac" wrote: Need to know what the rownumber is that you are trying to address. You subtracted 4096 from it. Are you sure that you did not finish up with a negative number so that you are trying to address a row off the top of the sheet. Check what value you have in cell H386 where you save rownumber. Regard, OssieMac "Fan924" wrote: Sub error() Dim RowNumber As Double Dim SecondDig As Double RowNumber = Range("E386").Value 'Read RowNumber # RowNumber = RowNumber - 4096 'Shift the RowNumber value Range("H386").Value = RowNumber 'Print to make sure it worked SecondDig = Range(RowNumber, 3).Value ' I get an error here ' using RowNumber as the row value Range("I386").Value = SecondDig End Sub I get an error message on line 7. I am using a variable as the roe number. What am I doing wrong? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
What am I doing wrong
Thanks OssieMac,
That got it. Your fast reply saved me a lot of time. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What is wrong with my UDF | Excel Discussion (Misc queries) | |||
What am I doing wrong? | Charts and Charting in Excel | |||
Insert Calculated Field (wrong Qty*Price = wrong Amount) | Excel Discussion (Misc queries) | |||
What Am I Doing Wrong | Excel Discussion (Misc queries) | |||
what am i doing wrong | Excel Programming |