Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ClearContents not clearing :(


Hi,

I am using the following to clear a range of cells but it dosen't
work please help

With
Workbooks("testcalcs_rev3.xls").Worksheets("initia l_information")
trm =
Workbooks("TestCalcs_rev3.xls").Names("Issue_term" ).RefersToRange.Value
If trm = 20 Then
Columns("C:L").Rows("70:89").ClearContents
End If
End With

I can run the clearcontents by itself and it works fine but i need to
be able to compare it to a value, hence the cell issue_term. if it
equals 20 then i need to delete the cells listed if not it needs to
just exit.

thanks for your time
joeH


--
JoeH
------------------------------------------------------------------------
JoeH's Profile: http://www.excelforum.com/member.php...o&userid=14138
View this thread: http://www.excelforum.com/showthread...hreadid=263686

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ClearContents not clearing :(

Dim trm as Long

With Workbooks("testcalcs_rev3.xls"). _
Worksheets("initial_information")
trm = Workbooks("TestCalcs_rev3.xls").Names( _
"Issue_term").RefersToRange.Value
msgbox trm
If trm = 20 Then
.Columns("C:L").Rows("70:89").ClearContents
End If
End With

Usually if something is within an IF construct and it doesn't occur, then
the if construct test is not being passed. Use the msgbox to check the
value of trm

--
Regards,
Tom Ogilvy


"JoeH" wrote in message
...

Hi,

I am using the following to clear a range of cells but it dosen't
work please help

With
Workbooks("testcalcs_rev3.xls").Worksheets("initia l_information")
trm =
Workbooks("TestCalcs_rev3.xls").Names("Issue_term" ).RefersToRange.Value
If trm = 20 Then
Columns("C:L").Rows("70:89").ClearContents
End If
End With

I can run the clearcontents by itself and it works fine but i need to
be able to compare it to a value, hence the cell issue_term. if it
equals 20 then i need to delete the cells listed if not it needs to
just exit.

thanks for your time
joeH


--
JoeH
------------------------------------------------------------------------
JoeH's Profile:

http://www.excelforum.com/member.php...o&userid=14138
View this thread: http://www.excelforum.com/showthread...hreadid=263686



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
Clearing cells without clearing formulas marsjune68 Excel Discussion (Misc queries) 2 April 10th 09 07:39 PM
Clearcontents Caroline Vincent Excel Programming 2 September 9th 04 11:03 AM
ClearContents Not Clearing Query Sean McPoland[_3_] Excel Programming 1 August 19th 04 07:39 PM
Clearcontents K Dales Excel Programming 0 February 27th 04 01:52 PM
Clearcontents Dick Kusleika[_3_] Excel Programming 0 February 17th 04 05:42 PM


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