View Full Version : Run time error '6'
nagavineela
07-30-2010, 02:58 AM
Hi,
dim lastrow as long
lastrow = Sheets("GroundFixed").Range("A4").End(xlDown).Row is throwing "Run time error 5".
Please help me
Thanks
Your thread title says 'run time error '6'. Then you say run time error 5.
Which is it?
I would note that you can get error 9 if the sheet is named differently (including if it has a leading/trailing space).
nagavineela
07-30-2010, 03:13 AM
sorry typo error. it is "6"
So it says "Overflow", right?
Presuming yes, I see that you have lastrow dim'd as a "long", but that the "l" is in lowercase. Is that what it looks like in the code window?
The only thing I can think of is if you actually have lastrow declared as an Integer or Byte or ???
Mark
nagavineela
07-30-2010, 03:46 AM
Yes you correct. correcting that issue got resolved. Thanks a lot.
Can i request you for one more requirement.
I have 2 comboboxes viz..,
cbomodulename and cbofailurerate.
when i select a module from "cbomodulename" the corresponding failure rate calculated should reflect automatically in "cbofailurerate".
My code is as follows:
For i = 4 To 19 Step 1
cbomodulename.AddItem Sheets("GroundFixed").Range("A" & i).Text
Next i
cbomodulename.ListIndex = 0
lastrow = Sheets("GroundFixed").Range("A4").End(xlDown).Row
With cbofailurerate
For i = 4 To lastrow + 1 - 1
Sheets("GroundFixed").Range("D" & i).Value = multiply(Range("B" & i).Value, Range("C" & i).Value)
.AddItem Sheets("GroundFixed").Cells(i, 4)
Next i
End With
Please help me in developing code for the requirement said above.
Thanks a lot
Not sure if I'll have the time to look right away, but for anyone wanting to help, please post a workbook with the UF's as you currently have them.
And...
...when i select a module from "cbomodulename" the corresponding failure rate calculated should reflect automatically in "cbofailurerate"....
...explain that part again. Leastwise for me, I am not following.
Mark
nagavineela
07-30-2010, 04:04 AM
Thank you. I thnik i cant attach to the posts am posting here. Can you please provide me your id so that i can mail.
Repeating the requirement:
let me take an example
I have one combobox which has "Subjects" as items and other has "Marks" of states listed in combobox1".
When i choose "Mathematics" in combobox1, combobox2 should populate "99" (i.e., marks fetched in mathematics"). Please let me know incase further clarification needed.
Thank you.
Use the Go Advanced button. Scroll down a bit and use Manage Attachments.
nagavineela
07-30-2010, 04:48 AM
Please find the sheet attached.
Thanks
Tinbendr
07-30-2010, 05:05 AM
New thread started here (http://www.vbaexpress.com/forum/showthread.php?p=221030#post221030).
Please don't start a new thread without putting a link to it.
Asking the same question in two different threads (or two different websites) is considered rude.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.