Consulting

Results 1 to 10 of 10

Thread: Run time error '6'

  1. #1

    Run time error '6'

    Hi,
    dim lastrow as long

    lastrow = Sheets("GroundFixed").Range("A4").End(xlDown).Row is throwing "Run time error 5".

    Please help me

    Thanks

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    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).

  3. #3
    sorry typo error. it is "6"

  4. #4
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    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

  5. #5
    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

  6. #6
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    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...
    Quote Originally Posted by nagavineela
    ...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

  7. #7
    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.

  8. #8
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Use the Go Advanced button. Scroll down a bit and use Manage Attachments.

  9. #9
    Please find the sheet attached.
    Thanks

  10. #10
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    New thread started here.

    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.

    David


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •