Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Delete a row

Hi,

I was wondering if anyone could provide me with a
function for a command button that when clicked, will
prompt the user for the row number they want to delete
and then delete it for them. Or if this is not possible,
something similar would also be great!!

Thanks for your help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Delete a row

Rhonda,

Use code like the following:

Dim RowNdx As Long
RowNdx = Application.InputBox(prompt:="Enter a row number",
Type:=1)
If RowNdx 0 And RowNdx <= Rows.Count Then
Rows(RowNdx).Delete
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Rhonda" wrote in message
...
Hi,

I was wondering if anyone could provide me with a
function for a command button that when clicked, will
prompt the user for the row number they want to delete
and then delete it for them. Or if this is not possible,
something similar would also be great!!

Thanks for your help!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Delete a row

Thank you very much!!! That's great!!


-----Original Message-----
Rhonda,

Use code like the following:

Dim RowNdx As Long
RowNdx = Application.InputBox(prompt:="Enter a row

number",
Type:=1)
If RowNdx 0 And RowNdx <= Rows.Count Then
Rows(RowNdx).Delete
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Rhonda" wrote in

message
...
Hi,

I was wondering if anyone could provide me with a
function for a command button that when clicked, will
prompt the user for the row number they want to delete
and then delete it for them. Or if this is not

possible,
something similar would also be great!!

Thanks for your help!



.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I delete a macro when the Delete button is not active? FCR Excel Worksheet Functions 0 March 9th 06 09:43 AM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM


All times are GMT +1. The time now is 10:38 PM.

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"