Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Using SpecialCells to return rows for deletion

Hi,

I have a table (in MS Excel) with values like this

LocalCurrency, Amt, BaseCurrency, ValueDt, TestColumn

I want to delete all rows where the column LocalCurrency=BaseCurrency

Of course I can create a loop through all the cells and delete the rows, but
I want a one line option if possible.

I have a column where a test is done that returns TRUE or FALSE if the
currencies match, but how can I use SpecialCells to return all those rows
where it is True and delete them?

I saw something along these lines a couple of months back but now cannot
find it..

thanks for any tips, or showing me the way

Philip
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Using SpecialCells to return rows for deletion

Hi,

I am trying to use something like this:

Range("F2",
Range("F2").End(xlDown).Address).SpecialCells(xlCe llTypeConstants,
"TRUE").EntireRow.Delete

but I get an error message - how can I get this to work.

Thanks for any help

Philip
"Philip" wrote:

Hi,

I have a table (in MS Excel) with values like this

LocalCurrency, Amt, BaseCurrency, ValueDt, TestColumn

I want to delete all rows where the column LocalCurrency=BaseCurrency

Of course I can create a loop through all the cells and delete the rows, but
I want a one line option if possible.

I have a column where a test is done that returns TRUE or FALSE if the
currencies match, but how can I use SpecialCells to return all those rows
where it is True and delete them?

I saw something along these lines a couple of months back but now cannot
find it..

thanks for any tips, or showing me the way

Philip

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Using SpecialCells to return rows for deletion

Found it!

Range("F2", Range("F2").End(xlDown).Address).FormulaR1C1 =
"=IF(RC[-1]<RC[-3],""OK"",NA())"
If Application.WorksheetFunction.CountA("#N/A") 0 Then
Range("F2",
Range("F2").End(xlDown).Address).SpecialCells(xlCe llTypeFormulas,
xlErrors).EntireRow.Delete
End If

But
thanks anyway

Philip

"Philip" wrote:

Hi,

I have a table (in MS Excel) with values like this

LocalCurrency, Amt, BaseCurrency, ValueDt, TestColumn

I want to delete all rows where the column LocalCurrency=BaseCurrency

Of course I can create a loop through all the cells and delete the rows, but
I want a one line option if possible.

I have a column where a test is done that returns TRUE or FALSE if the
currencies match, but how can I use SpecialCells to return all those rows
where it is True and delete them?

I saw something along these lines a couple of months back but now cannot
find it..

thanks for any tips, or showing me the way

Philip

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
comparing rows and deletion sreedhar[_8_] Excel Programming 11 October 11th 05 02:57 AM
On deletion of rows Stephen Howe Excel Discussion (Misc queries) 2 October 7th 05 06:02 PM
Prn file carriage return deletion within notepad monster Excel Programming 6 June 17th 05 09:11 PM
Problems copying Autofiltered rows & SpecialCells Philip Excel Programming 3 April 19th 05 09:03 PM
Help to hide rows, SpecialCells(xlCellTypeBlanks) doesn't work... Gunnar Johansson Excel Programming 6 August 15th 04 11:54 AM


All times are GMT +1. The time now is 12:22 AM.

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"