LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.misc
JMay
 
Posts: n/a
Default Deleting Rows Automatically using a Text File List

How do I assign a range name

Let's say you have information in Range A2:A800.
Click on cell A2 and drag (select or highlight) to Cell A800 - then you can (at
the menu) click on Insert, Name, Define.. in the top blank box type in
Myfiles.

That's how you create a range name.

click on the down-arrow in the box ABOVE Column A,
when you do you will see Myfiles in the list; left click on
Myfiles -- suddenly A2:A800 will be selected.

what is a standard module?

Hold down the Alt key and simultaneously press the F11
key. This will take you into the Visual Basic Editor (a separate program where
macros reside).

On the menu there, click on Insert, and select Module;
This will open a Blank Window.. it is in this window that
you should paste the

Sub ElimFileRow()
..... (7 line omitted here)
End Sub

Close the VBE program, this will take you back to The spreadsheet of Excel;

In cell C1 - type in a file you wish to delete (it's entire row).

Save the Workbook. Press Alt+F8
This will bring up the Macro Window..
Select ElimFileRow from the list (left-click it)
and then left click on the button RUN

Wa-La,,,,,

H(ope) T(his) H(elps)





"mirdonamy" wrote in
message ...

How do I assign a range name and what is a standard module (or how do I
create one). If this is simple enough to direct me through, I would
appreciate it. Otherwise, I am afraid I do not understand what to do
here. Sounds very useful though! I would really love to try this!

~Arielle

PS. Thank you for your kind response!

JMay Wrote:
Assign a range name "Myfiles" (without the quote)
to your 800 files (800 rows by 1 column) then

In a standard module paste in the beow code:

Sub ElimFileRow()
DelItem = Range("C1").Value
Set MyRange = Range("Myfiles")
For Each cell In MyRange
If cell.Value = DelItem Then
cell.EntireRow.Delete
End If
Next cell
End Sub

In cell C1 -- type in the exact file name you wish to delete,
as it appears in the range Myfiles.

Run the Macro ElimFileRow

HTH

"mirdonamy"
wrote in
message ...

I have a text file list of .jpg files that I want to delete (rows)

from
Excel. The list has 800+ items in it. Deleting these rows one at a
time in Excel (after doing a "find") is terribly time consuming.

Does
anyone know how to make Excel read my text file and delete the rows
with that filename in it (automatically). The filename (listed in

the
text file) is in a column (in my excel sheet) called "filename".

Any help would be most appreciated!!! Seriously! I may have to

spend
hours on this otherwise!

Thank you,
Arielle


--
mirdonamy

------------------------------------------------------------------------
mirdonamy's Profile:
http://www.excelforum.com/member.php...o&userid=30348
View this thread:

http://www.excelforum.com/showthread...hreadid=500059



--
mirdonamy
------------------------------------------------------------------------
mirdonamy's Profile:
http://www.excelforum.com/member.php...o&userid=30348
View this thread: http://www.excelforum.com/showthread...hreadid=500059



 
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
Filling Text from Another File lost in charts Excel Worksheet Functions 6 December 2nd 05 07:46 PM
how can i convert text file to excel file ? elcipser New Users to Excel 2 December 1st 05 04:09 PM
Importing text file to excel dany04 Excel Discussion (Misc queries) 1 November 9th 05 01:13 AM
Importing a text file into Excel with too many rows? Nexan Excel Discussion (Misc queries) 2 August 17th 05 01:52 PM
how i make a pgm in excel for copying all the rows to a new file . Copying after checking condition in Exce Excel Discussion (Misc queries) 1 April 3rd 05 06:43 PM


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