irresistible007
Board Regular
- Joined
- Nov 24, 2005
- Messages
- 173
Have a Text Box (country_name), a list Box (list_country) and a Add Button (add_country)
Following is the code, giving me the Automation Error + Unspecified error
Following is the code, giving me the Automation Error + Unspecified error
Code:
Option Explicit
Private Sub add_country_Click()
Dim rngcountries As Range
Set rngcountries = ActiveWorkbook.Sheets("Sheet1").Range("IV20").End(xlToLeft)
rngcountries.Offset(0, 1).Value = country_name.Text
country_name.Text = ""
Dim Cel As Range
list_country.Clear
For Each Cel In Range("A20:IV20")
If Cel.Value <> "" Then
list_country.AddItem Cel.Value
End If
Next Cel
End Sub