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 quot;findquot;) 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 quot;filenamequot;.
Any help would be most appreciated!!! Seriously! I may have to spend
hours on this otherwise!
Thank you,
Arielle--
mirdonamy
------------------------------------------------------------------------
mirdonamy's Profile: www.excelforum.com/member.php...oamp;userid=30348
View this thread: www.excelforum.com/showthread...hreadid=500059There may be a more elegant way of doing this, but a simple, non-VBA approach
might be to insert a column next to the column labled quot;Filenamequot; go to the
top line containing a file name and in the new column enter =Right(cellref,3)
(where cellref refers to the cell containing the first filename). Copy that
formula down to the bottom of your list. Then you could sort on the new
column and simply delete the block of rows where the new column has a value
of quot;jpgquot;.quot;mirdonamyquot; wrote:
gt;
gt; I have a text file list of .jpg files that I want to delete (rows) from
gt; Excel. The list has 800 items in it. Deleting these rows one at a
gt; time in Excel (after doing a quot;findquot;) is terribly time consuming. Does
gt; anyone know how to make Excel read my text file and delete the rows
gt; with that filename in it (automatically). The filename (listed in the
gt; text file) is in a column (in my excel sheet) called quot;filenamequot;.
gt;
gt; Any help would be most appreciated!!! Seriously! I may have to spend
gt; hours on this otherwise!
gt;
gt; Thank you,
gt; Arielle
gt;
gt;
gt; --
gt; mirdonamy
gt; ------------------------------------------------------------------------
gt; mirdonamy's Profile: www.excelforum.com/member.php...oamp;userid=30348
gt; View this thread: www.excelforum.com/showthread...hreadid=500059
gt;
gt;
Sorry, I misread your problem... but now that I've read a bit more closely, I
realize I don't quite understand. Do you import the text file to Excel and
then delete any row with one specified file name? or are you creating a new
text file with any file name deleted that is contained in a range contained
in a column with a label filename.
quot;mirdonamyquot; wrote:
gt;
gt; I have a text file list of .jpg files that I want to delete (rows) from
gt; Excel. The list has 800 items in it. Deleting these rows one at a
gt; time in Excel (after doing a quot;findquot;) is terribly time consuming. Does
gt; anyone know how to make Excel read my text file and delete the rows
gt; with that filename in it (automatically). The filename (listed in the
gt; text file) is in a column (in my excel sheet) called quot;filenamequot;.
gt;
gt; Any help would be most appreciated!!! Seriously! I may have to spend
gt; hours on this otherwise!
gt;
gt; Thank you,
gt; Arielle
gt;
gt;
gt; --
gt; mirdonamy
gt; ------------------------------------------------------------------------
gt; mirdonamy's Profile: www.excelforum.com/member.php...oamp;userid=30348
gt; View this thread: www.excelforum.com/showthread...hreadid=500059
gt;
gt;
Assign a range name quot;Myfilesquot; (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(quot;C1quot;).Value
Set MyRange = Range(quot;Myfilesquot;)
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
quot;mirdonamyquot; gt; wrote in
message ...
gt;
gt; I have a text file list of .jpg files that I want to delete (rows) from
gt; Excel. The list has 800 items in it. Deleting these rows one at a
gt; time in Excel (after doing a quot;findquot;) is terribly time consuming. Does
gt; anyone know how to make Excel read my text file and delete the rows
gt; with that filename in it (automatically). The filename (listed in the
gt; text file) is in a column (in my excel sheet) called quot;filenamequot;.
gt;
gt; Any help would be most appreciated!!! Seriously! I may have to spend
gt; hours on this otherwise!
gt;
gt; Thank you,
gt; Arielle
gt;
gt;
gt; --
gt; mirdonamy
gt; ------------------------------------------------------------------------
gt; mirdonamy's Profile:
gt; www.excelforum.com/member.php...oamp;userid=30348
gt; View this thread: www.excelforum.com/showthread...hreadid=500059
gt;
Select that column that contains quot;FileNamequot;
data|filter|autofilter
filter to just show those lines to be deleted
select those visible cells
edit|delete
The Data|Filter|autofilter to remove the filter.
mirdonamy wrote:
gt;
gt; I have a text file list of .jpg files that I want to delete (rows) from
gt; Excel. The list has 800 items in it. Deleting these rows one at a
gt; time in Excel (after doing a quot;findquot;) is terribly time consuming. Does
gt; anyone know how to make Excel read my text file and delete the rows
gt; with that filename in it (automatically). The filename (listed in the
gt; text file) is in a column (in my excel sheet) called quot;filenamequot;.
gt;
gt; Any help would be most appreciated!!! Seriously! I may have to spend
gt; hours on this otherwise!
gt;
gt; Thank you,
gt; Arielle
gt;
gt; --
gt; mirdonamy
gt; ------------------------------------------------------------------------
gt; mirdonamy's Profile: www.excelforum.com/member.php...oamp;userid=30348
gt; View this thread: www.excelforum.com/showthread...hreadid=500059
--
Dave Peterson
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:
gt; Assign a range name quot;Myfilesquot; (without the quote)
gt; to your 800 files (800 rows by 1 column) then
gt;
gt; In a standard module paste in the beow code:
gt;
gt; Sub ElimFileRow()
gt; DelItem = Range(quot;C1quot;).Value
gt; Set MyRange = Range(quot;Myfilesquot;)
gt; For Each cell In MyRange
gt; If cell.Value = DelItem Then
gt; cell.EntireRow.Delete
gt; End If
gt; Next cell
gt; End Sub
gt;
gt; In cell C1 -- type in the exact file name you wish to delete,
gt; as it appears in the range Myfiles.
gt;
gt; Run the Macro ElimFileRow
gt;
gt; HTH
gt;
gt; quot;mirdonamyquot; gt;
gt; wrote in
gt; message ...
gt; gt;
gt; gt; I have a text file list of .jpg files that I want to delete (rows)
gt; from
gt; gt; Excel. The list has 800 items in it. Deleting these rows one at a
gt; gt; time in Excel (after doing a quot;findquot;) is terribly time consuming.
gt; Does
gt; gt; anyone know how to make Excel read my text file and delete the rows
gt; gt; with that filename in it (automatically). The filename (listed in
gt; the
gt; gt; text file) is in a column (in my excel sheet) called quot;filenamequot;.
gt; gt;
gt; gt; Any help would be most appreciated!!! Seriously! I may have to
gt; spend
gt; gt; hours on this otherwise!
gt; gt;
gt; gt; Thank you,
gt; gt; Arielle
gt; gt;
gt; gt;
gt; gt; --
gt; gt; mirdonamy
gt; gt;
gt; ------------------------------------------------------------------------
gt; gt; mirdonamy's Profile:
gt; gt; www.excelforum.com/member.php...oamp;userid=30348
gt; gt; View this thread:
gt; www.excelforum.com/showthread...hreadid=500059
gt; gt;--
mirdonamy
------------------------------------------------------------------------
mirdonamy's Profile: www.excelforum.com/member.php...oamp;userid=30348
View this thread: www.excelforum.com/showthread...hreadid=500059
I have a text file with a list of filenames (all .jpg) that I want to
delete from my Excel sheet (the entire row, not just the filename).
Without looking up each one of the files (listed in the text file) and
deleting the row manually, I would like to eliminate the rows
containing this filename.
I am sure there's a way to automate this! I just don't know how, and I
do not know Excel as well as some people here. I don't know macros or
anything. I just know Excel better than anyone at my office (which
doesn't say much I guess).
~ Arielle
SludgeQuake Wrote:
gt; Sorry, I misread your problem... but now that I've read a bit more
gt; closely, I
gt; realize I don't quite understand. Do you import the text file to Excel
gt; and
gt; then delete any row with one specified file name? or are you creating a
gt; new
gt; text file with any file name deleted that is contained in a range
gt; contained
gt; in a column with a label filename.
gt;
gt; quot;mirdonamyquot; wrote:
gt;
gt; gt;
gt; gt; I have a text file list of .jpg files that I want to delete (rows)
gt; from
gt; gt; Excel. The list has 800 items in it. Deleting these rows one at a
gt; gt; time in Excel (after doing a quot;findquot;) is terribly time consuming.
gt; Does
gt; gt; anyone know how to make Excel read my text file and delete the rows
gt; gt; with that filename in it (automatically). The filename (listed in
gt; the
gt; gt; text file) is in a column (in my excel sheet) called quot;filenamequot;.
gt; gt;
gt; gt; Any help would be most appreciated!!! Seriously! I may have to
gt; spend
gt; gt; hours on this otherwise!
gt; gt;
gt; gt; Thank you,
gt; gt; Arielle
gt; gt;
gt; gt;
gt; gt; --
gt; gt; mirdonamy
gt; gt;
gt; ------------------------------------------------------------------------
gt; gt; mirdonamy's Profile:
gt; www.excelforum.com/member.php...oamp;userid=30348
gt; gt; View this thread:
gt; www.excelforum.com/showthread...hreadid=500059
gt; gt;
gt; gt;--
mirdonamy
------------------------------------------------------------------------
mirdonamy's Profile: www.excelforum.com/member.php...oamp;userid=30348
View this thread: www.excelforum.com/showthread...hreadid=500059
I came up with 1/2 a solution. I added the list of filenames (to the
filename row in Excel) and then sorted by filename. Now, everytime
there's a partially blank line, I know to delete both (the line above
it and the partially blank line). Still, that's 800 manual
deletions.
Is there anyway to filter quot;duplicatequot; entries of a particular column?
I tried filter / custom; but, all I came up with was the ability to
filter by something from a drop down list. How do I filter by
quot;duplicatequot; entry in a certain column?--
mirdonamy
------------------------------------------------------------------------
mirdonamy's Profile: www.excelforum.com/member.php...oamp;userid=30348
View this thread: www.excelforum.com/showthread...hreadid=500059
I can't get quot;Filter for Unique Recordsquot; to work properly. I want to
delete rows with duplicate filenames. The rows are all unique (as some
have ONLY filenames and some have info in the other colums as well).
How do I filter or delete rows with duplicate filenames. Unique
records does not work, again, as all records are unique.--
mirdonamy
------------------------------------------------------------------------
mirdonamy's Profile: www.excelforum.com/member.php...oamp;userid=30348
View this thread: www.excelforum.com/showthread...hreadid=500059How 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)quot;mirdonamyquot; gt; wrote in
message ...
gt;
gt; How do I assign a range name and what is a standard module (or how do I
gt; create one). If this is simple enough to direct me through, I would
gt; appreciate it. Otherwise, I am afraid I do not understand what to do
gt; here. Sounds very useful though! I would really love to try this!
gt;
gt; ~Arielle
gt;
gt; PS. Thank you for your kind response!
gt;
gt; JMay Wrote:
gt;gt; Assign a range name quot;Myfilesquot; (without the quote)
gt;gt; to your 800 files (800 rows by 1 column) then
gt;gt;
gt;gt; In a standard module paste in the beow code:
gt;gt;
gt;gt; Sub ElimFileRow()
gt;gt; DelItem = Range(quot;C1quot;).Value
gt;gt; Set MyRange = Range(quot;Myfilesquot;)
gt;gt; For Each cell In MyRange
gt;gt; If cell.Value = DelItem Then
gt;gt; cell.EntireRow.Delete
gt;gt; End If
gt;gt; Next cell
gt;gt; End Sub
gt;gt;
gt;gt; In cell C1 -- type in the exact file name you wish to delete,
gt;gt; as it appears in the range Myfiles.
gt;gt;
gt;gt; Run the Macro ElimFileRow
gt;gt;
gt;gt; HTH
gt;gt;
gt;gt; quot;mirdonamyquot; gt;
gt;gt; wrote in
gt;gt; message ...
gt;gt; gt;
gt;gt; gt; I have a text file list of .jpg files that I want to delete (rows)
gt;gt; from
gt;gt; gt; Excel. The list has 800 items in it. Deleting these rows one at a
gt;gt; gt; time in Excel (after doing a quot;findquot;) is terribly time consuming.
gt;gt; Does
gt;gt; gt; anyone know how to make Excel read my text file and delete the rows
gt;gt; gt; with that filename in it (automatically). The filename (listed in
gt;gt; the
gt;gt; gt; text file) is in a column (in my excel sheet) called quot;filenamequot;.
gt;gt; gt;
gt;gt; gt; Any help would be most appreciated!!! Seriously! I may have to
gt;gt; spend
gt;gt; gt; hours on this otherwise!
gt;gt; gt;
gt;gt; gt; Thank you,
gt;gt; gt; Arielle
gt;gt; gt;
gt;gt; gt;
gt;gt; gt; --
gt;gt; gt; mirdonamy
gt;gt; gt;
gt;gt; ------------------------------------------------------------------------
gt;gt; gt; mirdonamy's Profile:
gt;gt; gt; www.excelforum.com/member.php...oamp;userid=30348
gt;gt; gt; View this thread:
gt;gt; www.excelforum.com/showthread...hreadid=500059
gt;gt; gt;
gt;
gt;
gt; --
gt; mirdonamy
gt; ------------------------------------------------------------------------
gt; mirdonamy's Profile:
gt; www.excelforum.com/member.php...oamp;userid=30348
gt; View this thread: www.excelforum.com/showthread...hreadid=500059
gt;
- May 27 Tue 2008 20:43
Deleting Rows Automatically using a Text File List
close
全站熱搜
留言列表
發表留言
留言列表

