LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default vba - need simple function to delete ranges

Then just change mine to

Public Sub test()
Dim cell As Range
Dim crows As Long

For Each cell In ActiveSheet.UsedRange
If LCase(cell.Value) = "#n/a" Then
crows = Cells(Rows.Count, cell.Column).End(xlUp).Row
Range(Cells(cell.Row, cell.Column), Cells(crows,
cell.Column)).ClearContents
End If
Next cell
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"tom g" <tom wrote in message
...
thanks guys that helps.. the only problem is that its not a function

error.
its hard typed #NA ... it could easily be the word 'WRONG' as well.
how would i define that.
thanks, thomas

"tom g" wrote:

hi,
i'm very new to vba for excel.. working with very easy examples.

wondering
if anyone can help me with a repetitive task.
i have data comming in to various columns. at some data there is a #NA,

i'd
like to delete everything in that column after that #NA, and then move

on to
the next column and repeat the task.

thanks, thomas





 
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
Delete unnecessary Named Ranges berniean Excel Discussion (Misc queries) 1 August 27th 09 07:24 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Allow user to delete cell ranges? Dave Mathew Excel Discussion (Misc queries) 3 May 7th 07 04:54 PM
Named ranges interfere with simple formulas RoyWollen Excel Discussion (Misc queries) 2 September 30th 06 10:53 PM
delete or edit named dell ranges chris31849 Excel Discussion (Misc queries) 5 March 9th 06 10:58 PM


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