LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Deleting cells in a loop

I am trying to use a loop to select a particular criteria (i.e. col AR = True
and then delete certain cells in that row. It was suggested I use
..clearcontents but I encountered an error something like "can't change merged
cell." I looked up a post that then suggested using .value = "" to handle
this error.

But the main reason for writing is that this loop isn't working. No cells
are being deleted. Any help would be greatly appreciated.

-Andy





With Sheets("Analysis")
Set TradesEntered = .Range("at17:at56")
End With
Dim clearrow

'Loop: Check for complete trades, delete

For X = 1 To TradesEntered.Count
Set ClosCheck = TradesEntered(X)

' For Each PastCheck In TradesEnteredPast


If ClosCheck.Value = "True" Then
With ClosCheck
'.Worksheet.Select
clearrow = ActiveCell.Row
Range("A" & clearrow & ":F" & clearrow).Value = ""
Range("K" & clearrow & ":M" & clearrow).Value = ""
Range("O" & clearrow & ":S" & clearrow).Value = ""
End With

End If
Next
 
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
How to continue loop after deleting row? [email protected] Excel Programming 4 April 10th 06 01:55 PM
Deleting rows loop briskbaby Excel Programming 4 October 7th 05 09:10 PM
deleting rows, endless loop maybe ? dick[_2_] Excel Programming 3 June 28th 05 06:35 PM
Help - loop through cells in a range that are not together (several different cells as Target) Marie J-son[_5_] Excel Programming 4 April 3rd 05 09:54 PM
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content rmaloy Excel Programming 5 February 9th 04 01:59 AM


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