Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting Rows using VBA


All I have found as far as tutorials is how to delete empty rows by
using a calculation to determine if the row is empty. Is there any way
to simply say, "delete row 3" or something of that nature. Based on
user input I will know the exact row number to delete and this would
help alot. thanks.


--
SystemHack
------------------------------------------------------------------------
SystemHack's Profile: http://www.excelforum.com/member.php...o&userid=26614
View this thread: http://www.excelforum.com/showthread...hreadid=400351

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Deleting Rows using VBA

Hi

....
Worksheets("SheetName").Rows(RowNumber1 & ":" & RowNumber2).Delete
Shift:=xlUp
....

(the worksheet mustn't be activated)

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )



"SystemHack" wrote
in message ...

All I have found as far as tutorials is how to delete empty rows by
using a calculation to determine if the row is empty. Is there any way
to simply say, "delete row 3" or something of that nature. Based on
user input I will know the exact row number to delete and this would
help alot. thanks.


--
SystemHack
------------------------------------------------------------------------
SystemHack's Profile:
http://www.excelforum.com/member.php...o&userid=26614
View this thread: http://www.excelforum.com/showthread...hreadid=400351



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Deleting Rows using VBA

ans = InputBox("Delete which row?")
Rows(ans).Delete

--

HTH

RP
(remove nothere from the email address if mailing direct)


"SystemHack" wrote
in message ...

All I have found as far as tutorials is how to delete empty rows by
using a calculation to determine if the row is empty. Is there any way
to simply say, "delete row 3" or something of that nature. Based on
user input I will know the exact row number to delete and this would
help alot. thanks.


--
SystemHack
------------------------------------------------------------------------
SystemHack's Profile:

http://www.excelforum.com/member.php...o&userid=26614
View this thread: http://www.excelforum.com/showthread...hreadid=400351



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting Rows using VBA

ans = InputBox("Delete which row?")
On Error Resume next
set rng = Rows(ans)
On errror goto 0
if not rng is nothing then
rng.Delete
end if

--
Regards,
Tom Ogilvy


"SystemHack" wrote
in message ...

All I have found as far as tutorials is how to delete empty rows by
using a calculation to determine if the row is empty. Is there any way
to simply say, "delete row 3" or something of that nature. Based on
user input I will know the exact row number to delete and this would
help alot. thanks.


--
SystemHack
------------------------------------------------------------------------
SystemHack's Profile:

http://www.excelforum.com/member.php...o&userid=26614
View this thread: http://www.excelforum.com/showthread...hreadid=400351



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
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Links and Linking in Excel 1 November 13th 08 08:44 AM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Setting up and Configuration of Excel 1 November 12th 08 06:05 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Worksheet Functions 1 November 12th 08 01:39 PM
Help!! I have problem deleting 2500 rows of filtered rows!!!! shirley_kee Excel Discussion (Misc queries) 1 January 12th 06 03:24 AM
deleting hidden rows so i can print only the rows showing?????? jenn Excel Worksheet Functions 0 October 6th 05 04:05 PM


All times are GMT +1. The time now is 07:51 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"