Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default immediate help please

i am now able to insert data in an excel spread sheet using a user for
thanks to Tom Ogilvy, but i also need to update and delete dat
sometimes from the excel spreadsheet using user forms....for example
want to update or delete a row where employee id=100

please help me, i need to solve this problem immedaitel

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default immediate help please

Assume you have a combobox that lists employee ID's (combobox1) and a
button named cmd_DeleteChoice that when pushed, you want to delete the
employee-id selected in combobox1.

Assume Empoyee data is in a sheet named DATA and the employee ID's start in
A2 with contiguous entries to the last employee.

Private Sub Userform_Initialize()
Dim rng as Range
With Worksheets("Data")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
end with
Combobox1.List = rng
End Sub

Private Sub Cmd_DeleteChoice()
Dim rng as Range
With Worksheets("Data")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
end with
if combobox1.ListIndex < -1 then
rng(Combobox1.ListIndex+1).EntireRow.Delete
' now reset combobox1 list
With Worksheets("Data")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
end with
Combobox1.List = rng.Value
end If
End sub

--
Regards,
Tom Ogilvy

"programmer_int " wrote in
message ...
i am now able to insert data in an excel spread sheet using a user form
thanks to Tom Ogilvy, but i also need to update and delete data
sometimes from the excel spreadsheet using user forms....for example i
want to update or delete a row where employee id=100

please help me, i need to solve this problem immedaitely


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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"