Using Excel's Visual Basic mode, I'm creating a customer master record form. It has a button called " new ". In this button it would add a value to the Code field that is in the excel worksheet. However, when I test it it displays the following message:
Run-time error '9': Subscript out of range
And when I click debug, it points to the following line of code as 'wrong':
Do Until Sheets("CLIENTES").Cells(linha, 1) = ""
What should I do to resolve this problem?