View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RPIJG[_36_] RPIJG[_36_] is offline
external usenet poster
 
Posts: 1
Default Problem with adding an item

I'm having a problem adding an item to a list in a combobox that i
bound to a worksheet.



Code
-------------------

Private Sub AddName_Click()
Dim SourceData As Range
Dim Found As Object

Set SourceData = Range("customerinfo")
Set Found = Nothing
Set Found = SourceData.Find(NameBox.Value)

If Found Is Nothing Then
SourceData.Resize(SourceData.Rows.Count + 1, 1).Name = "CustomerInfo"
SourceData.Offset(SourceData.Rows.Count, 0).Resize(1, 1).Value = NameBox.Value
NameBox.RowSource = Range("customerinfo").Address(external:=True)
End If
End Sub

-------------------


The Error I get is..Run-time error 1004, Method 'Range' of '_Global
Faile

--
Message posted from http://www.ExcelForum.com