Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with my UDF jlclyde Excel Discussion (Misc queries) 4 October 24th 08 03:06 PM
What am I doing wrong? tjbo Charts and Charting in Excel 3 October 10th 08 02:08 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
What Am I Doing Wrong comparini3000 Excel Discussion (Misc queries) 1 June 12th 06 05:51 PM
what am i doing wrong short_n_curly[_12_] Excel Programming 7 July 13th 05 06:34 PM


All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"