0

Actually I made the project in Excel VBA , and I wanted to hide ThisWorkbook.visible=False when the files open and then load the userform. However I the project is running fantastic but when i hide my thisworkbook then i am getting an error like "method rows of object _global failed" on For Cmb = 2 To .Cells(Rows.Count, 27).End(xlUp).Row

Sub ComboAddItems()
    Dim Lc, Cmb, CmbItm As Integer
    With ThisWorkbook.Worksheets("Tool Work")
        For Cmb = 2 To .Cells(Rows.Count, 27).End(xlUp).Row
            Lc = .Range(.Cells(Cmb, 28), .Cells(Cmb, 28).End(xlToRight)).Count
            For CmbItm = 1 To Lc
                UserForm1.Controls(.Cells(Cmb, 27).Value).AddItem .Cells(Cmb, 27 + CmbItm).Value
            Next CmbItm
        Next Cmb
    End With
End Sub

1 Answer 1

1

You're missing a qualifier:

For Cmb = 2 To .Cells(.Rows.Count, 27).End(xlUp).Row

note the full stop before the Rows.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.