Announcement

Collapse
No announcement yet.

Unconfigured Ad Widget

Collapse

VBA: Next without for?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VBA: Next without for?

    Hi again,

    Can anybody figure out what I am doing wrong? Excel says "Next without for":

    Code:
    For i = 3 To no_cont + 2
    
    pol = Worksheets("INPUT").Cells(i, 1).Value
    pod = Worksheets("INPUT").Cells(i, 2).Value
    pofd = Worksheets("INPUT").Cells(i, 3).Value
    cont_id = Worksheets("INPUT").Cells(i, 4).Value
    qty = Worksheets("INPUT").Cells(i, 5).Value
    cont_type = Worksheets("INPUT").Cells(i, 8).Value
    cont_weight = Worksheets("INPUT").Cells(i, 9).Value
    cont_line = Worksheets("INPUT").Cells(i, 11).Value
    stow = Worksheets("INPUT").Cells(i, 20).Value
        Select Case Worksheets("INPUT").Cells(i, 11).Value
        Case "E"
        mty_val.Value = "Y"
        Case Else
        mty_val.Value = "N"
        End Select
        
        Select Case Worksheets("INPUT").Cells(i, 20).Value
        Case Is <> ""
        stow = Worksheets("INPUT").Cells(i, 20).Value
        Case Else
        stow = "      "
        
    
    Print #FileNum, Space(3); qty & cont_id & " " & cont_type & Format$(cont_weight, "0.00") & pol & pod & pofd & cont_line; Spc(2); stow; Spc(2); prv_stow _
    
    Next i
    Regards

  • #2
    Re: VBA: Next without for?

    Looks like it's because you don't have an End Select for your second Select Case.
    Last edited by thomach; May 12th, 2006, 00:08.
    Best Regards,
    Tom
    ---------------------------
    Please help Oz share knowledge among all users by posting your questions in a public forum rather than using a Private Message.

    Comment


    • #3
      [SOLVED] VBA: Next without for?

      Thank you very much thomach. Solved immediately

      Comment

      Trending

      Collapse

      There are no results that meet this criteria.

      Working...
      X