Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / September 2006

Tip: Looking for answers? Try searching our database.

Delete records in a worksheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rixanna - 12 Sep 2006 07:27 GMT
I'm working on a simple program that lets the user enter, edit and
print the data. I developed the program using Microsoft Excel 2003 with
VBE.

The problem is that, under Edit button I want to enable the user to
edit the existing data and save as well as to save as another name.

But, how to let the user delete the data in the worksheet?

Example :
When the user clicked on Delete button, an input box will appear as to
ask which data to be deleted. When the user entered the name of the
file, it will automatically delete the entire data corresponding to the
filename.

There are 2 datas with 3 sub-datas in a worksheet named BOOK TABLE.
a)Data : Fish
  Sub-data : Whale, Jelly fish, Jaws
b)Flower
  Sub-data : Rose, Sunflower, Tulip

When the user asked to delete the data for Fish, it will automatically
erase all the data and sub-data.

Any ideas?
Thanks in advanced
glenton (glenton@leviqqio.com - 12 Sep 2006 12:02 GMT
a simple loop from the bottom of your data table to the top, deleting entire
rows when appropriate should do the trick.

something like
Sub delete()

MyDel = InputBox("Delete?")

For i = Range("a1:a10000").Count To 1 Step -1
If Cells(i + 3, "a") = MyDel Then
   Cells(i + 3, "a").EntireRow.delete
End If
Next i

End Sub

Hope this helps

Glenton

> I'm working on a simple program that lets the user enter, edit and
> print the data. I developed the program using Microsoft Excel 2003 with
[quoted text clipped - 22 lines]
> Any ideas?
> Thanks in advanced
rixanna - 13 Sep 2006 04:31 GMT
Thank you sooo much..it really works.

Thanks a lot
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.