Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding a word, then deleting every row above that?


Hello happy people,

I've done a macro, that opens a huge text file in excel (as i have
some figures to extract from it).
I can select a text file, it opens it, it converts it to columns, it
automatically finds a keyword and selects the word..

What should i use to delete all the rows above the selected cell?

Thank you!


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=534466

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Finding a word, then deleting every row above that?

After a cell has been selected:

Sub gnsu ()
Dim L As Long
L = Selection.Row - 1
If L 0 Then
s = "1:" & L
Rows(s).Select
Selection.Delete Shift:=xlUp
End If
End Sub

will delete all the rows above it.
--
Gary''s Student


"drucey" wrote:


Hello happy people,

I've done a macro, that opens a huge text file in excel (as i have
some figures to extract from it).
I can select a text file, it opens it, it converts it to columns, it
automatically finds a keyword and selects the word..

What should i use to delete all the rows above the selected cell?

Thank you!


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=534466


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding a word, then deleting every row above that?


Garys Student, thank you so much. You are the best person i know today.


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=534466

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Finding a word, then deleting every row above that?

You are very welcome
--
Gary's Student


"drucey" wrote:


Garys Student, thank you so much. You are the best person i know today.


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=534466


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
Finding Multiple Entries & Deleting All but One Brandy Excel Discussion (Misc queries) 7 January 10th 08 02:27 PM
Finding a cell match then deleting a row. Tim M Excel Discussion (Misc queries) 2 May 18th 06 05:03 PM
Finding and Deleting QPapillon New Users to Excel 2 March 14th 06 03:04 AM
Finding and Deleting duplicates in a column Brian Excel Worksheet Functions 3 February 5th 05 02:19 PM
Finding and Deleting last row Bourbon Excel Programming 3 November 12th 03 11:54 PM


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

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

About Us

"It's about Microsoft Excel"