View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Marek Marek is offline
external usenet poster
 
Posts: 1
Default LISTOBJECT question

it is correct way to complete my task or not

my task is:

1. using combobox i can add and delete items in Listobject object

on the worksheet i have 3 components

combobo
button.add ( add item from combobox to listobject object )
button.delete ( delete item from listobject object )


my function to add items into combobox is next

Sub FizikaObjectAdd()
With Worksheets(4).ListObjects(1)
Set newrow = .ListRows.Add
Worksheets(4).Cells(.ListRows(newrow.Index).Range. Row
.ListColumns(1).Range.Column).Value = Worksheets(1).combo3.Text
Worksheets(4).Cells(.ListRows(newrow.Index).Range. Row
.ListColumns(2).Range.Column).Value = CStr(newrow.Index)
End With

Call ObjectListRefresh
End Sub


function to delete items from listobject object is next

Sub FizikaObjectDelete()
With Worksheets(4).ListObjects(1)
For c1 = .ListRows.Count To 1 Step -1
If Worksheets(4).Cells(.ListRows(c1).Range.Row
.ListColumns(1).Range.Column).Text = Worksheets(1).combo3.Text Then
.ListRows(c1).Delete
End If
Next
End With
Call FizikaObjectListRefresh
End Sub



can anyone tell me if my solution correct,

why i ask you ?, because i dont realy know is my way to access items i
the listobject object correct or not ?

for example
Worksheets(4).Cells(.ListRows(c1).Range.Row
.ListColumns(1).Range.Column).Tex

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