PC Review


Reply
Thread Tools Rate Thread

delete next cell

 
 
=?Utf-8?B?ZGVsbWFj?=
Guest
Posts: n/a
 
      2nd Oct 2006
Hi all, I've 2 columns:about 500 rows long. I dont need the rows where column
A contains a number ending in D such as 123-D. can anyone suggest a quick way
of deleting theses. I have over 10 sheets with hundreds of items . Thanks
agin.
A B
100-C Description
123-D Description
130-D Description
500-T Description
--
delmac
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      2nd Oct 2006
try something like this

for each ws in worksheets
with ws
for i=.cells(.rows.count,1).end(xlup).row
if ucase(right(.cells(i,1),1))="D" then .rows(i).delete
end with
next ws
next i

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"delmac" <(E-Mail Removed)> wrote in message
news:A6A4A41F-0D67-4957-89E2-(E-Mail Removed)...
> Hi all, I've 2 columns:about 500 rows long. I dont need the rows where
> column
> A contains a number ending in D such as 123-D. can anyone suggest a quick
> way
> of deleting theses. I have over 10 sheets with hundreds of items . Thanks
> agin.
> A B
> 100-C Description
> 123-D Description
> 130-D Description
> 500-T Description
> --
> delmac



 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      2nd Oct 2006
This will clear the contents of the entire row if the value in A of the
current row ends with "D". Once completed, you would then need to sort
your data to remove the empty rows.

Sub test()
For Each cell In Range("A1:A" & Range("A65536").End(xlUp).Row)
If Right(cell, 1) = "D" Then cell.EntireRow.ClearContents
Next cell

End Sub


HTH,
Paul

"delmac" <(E-Mail Removed)> wrote in message
news:A6A4A41F-0D67-4957-89E2-(E-Mail Removed)...
> Hi all, I've 2 columns:about 500 rows long. I dont need the rows where
> column
> A contains a number ending in D such as 123-D. can anyone suggest a quick
> way
> of deleting theses. I have over 10 sheets with hundreds of items . Thanks
> agin.
> A B
> 100-C Description
> 123-D Description
> 130-D Description
> 500-T Description
> --
> delmac



 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      2nd Oct 2006
forgot to do a next
if ucase(right(.cells(i,1),1))="D" then .rows(i).delete
next i 'add
end with


--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Don Guillett" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> try something like this
>
> for each ws in worksheets
> with ws
> for i=.cells(.rows.count,1).end(xlup).row
> if ucase(right(.cells(i,1),1))="D" then .rows(i).delete
> end with
> next ws
> next i
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "delmac" <(E-Mail Removed)> wrote in message
> news:A6A4A41F-0D67-4957-89E2-(E-Mail Removed)...
>> Hi all, I've 2 columns:about 500 rows long. I dont need the rows where
>> column
>> A contains a number ending in D such as 123-D. can anyone suggest a quick
>> way
>> of deleting theses. I have over 10 sheets with hundreds of items . Thanks
>> agin.
>> A B
>> 100-C Description
>> 123-D Description
>> 130-D Description
>> 500-T Description
>> --
>> delmac

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird: inside of a cell I have a small box or cell I can't delete. ACECOWBOY Microsoft Excel Misc 3 20th Oct 2009 01:41 PM
How do you delete a cell without going Table>Select>Cell then Table>Delete>Cell - phew! JethroUK© Microsoft Frontpage 3 8th Jun 2009 10:58 PM
Delete Rows if any cell in Column H is blank but do not Delete Fir =?Utf-8?B?bWFuZmFyZWVk?= Microsoft Excel Programming 4 28th Sep 2007 05:20 PM
How to delete cell values withour deleting cell formulae perfection Microsoft Excel Misc 5 18th Jun 2007 09:05 PM
Delete cell contents with input to adjacent cell Ashley Frank Microsoft Excel Misc 1 5th Oct 2005 04:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:08 AM.