View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Remove row in list based on user input

Ask for them to point and click on a range (using type:=8)

Dim myRng as range
set myrng = nothing
on error resume next
set myrng = application.inputbox(Prompt:="Select a range of rows to delete", _
type:=8).areas(1) 'single area only!
on error goto 0

if myrng is nothing then
exit sub 'user hit cancel
else
myrng.entirerow.delete
end if

If you only wanted to allow them to delete a single row at a time:

set myrng = application.inputbox(Prompt:="Select a range of rows to delete", _
type:=8).cells(1)



Beeo wrote:

Hello

I have a data-list (excel 2003) with records and the following code

RowNo = Application.InputBox(Prompt:="Click on the row you wish to
delete", Title:="Delete row", Type:=1 + 2)
Selection.ListObject.ListRows(RowNo).Delete

But it's not working. Help appreciated (I'm new to this so please be
nice :)

Tia / Beeo


--

Dave Peterson