#1   Report Post  
Posted to microsoft.public.excel.misc
Chuck Neal
 
Posts: n/a
Default Delete cell content

Hi,
I need to incorporate some code into my series of macros. I need to be able
to check the entire worksheet and if "TRAN" appears anywhere, I need to clear
the contents of that cell. Only the word TRAN, if it says TRANSLATE or some
other similar word, I need it to stay. Since it would be a part of the macro
series, filtering won't work because the data changes daily and I need it
fairly automated.

Thanks in advance,
Chuck
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Delete cell content

Call this:

Sub gsnu()
Dim r As Range
For Each r In ActiveSheet.UsedRange
If r.Value = "TRAN" Then r.Clear
Next
End Sub

--
Gary's Student


"Chuck Neal" wrote:

Hi,
I need to incorporate some code into my series of macros. I need to be able
to check the entire worksheet and if "TRAN" appears anywhere, I need to clear
the contents of that cell. Only the word TRAN, if it says TRANSLATE or some
other similar word, I need it to stay. Since it would be a part of the macro
series, filtering won't work because the data changes daily and I need it
fairly automated.

Thanks in advance,
Chuck

  #3   Report Post  
Posted to microsoft.public.excel.misc
Bearacade
 
Posts: n/a
Default Delete cell content


Sub ClearTran()
Cells.Replace What:="TRAN", Replacement:="", LookAt:=xlWhole,
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
ReplaceFormat:=False
End Sub


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=551901

  #4   Report Post  
Posted to microsoft.public.excel.misc
Chuck Neal
 
Posts: n/a
Default Delete cell content

That did it! Thanks so much!

"Gary''s Student" wrote:

Call this:

Sub gsnu()
Dim r As Range
For Each r In ActiveSheet.UsedRange
If r.Value = "TRAN" Then r.Clear
Next
End Sub

--
Gary's Student


"Chuck Neal" wrote:

Hi,
I need to incorporate some code into my series of macros. I need to be able
to check the entire worksheet and if "TRAN" appears anywhere, I need to clear
the contents of that cell. Only the word TRAN, if it says TRANSLATE or some
other similar word, I need it to stay. Since it would be a part of the macro
series, filtering won't work because the data changes daily and I need it
fairly automated.

Thanks in advance,
Chuck

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
Conditional Formatting if cell content is a formula oldsambvca Excel Worksheet Functions 2 June 6th 06 10:24 PM
How to click on a cell and have the content of the cell display in a different cell [email protected] Excel Worksheet Functions 0 June 6th 06 03:05 PM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
can't delete a cell content in excel Mark B New Users to Excel 3 May 6th 05 06:42 PM


All times are GMT +1. The time now is 04:54 PM.

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"