#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 328
Default Loop Column

I am new to Macros in Excel can someone please help. I am trying to turn this
macro into a loop that will go from column c to column r. Now I have the same
Step copyed over and over again.

For i = 2 To 200 Step 1
e = "c" & i
x = Range(e).Interior.Color
Select Case x
Case 12632256
Range(e).Value = ""
With Range(e).Interior
.Pattern = xlNone
End With
End Select
Next
For i = 2 To 200 Step 1
e = "d" & i
x = Range(e).Interior.Color
Select Case x
Case 12632256
Range(e).Value = ""
With Range(e).Interior
.Pattern = xlNone
End With

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 947
Default Loop Column

Not tested, but any ideas here that could help?

Sub Demo()
Const lColor As Long = 12632256
Dim Cell As Range

For Each Cell In [C2:R200].Cells
If Cells.Interior.Color = lColor Then
Cells.Value = vbNullString
Cells.Interior.Pattern = xlNone
End If
Next Cell
End Sub

--
Dana DeLouis


"Lisa" wrote in message
...
I am new to Macros in Excel can someone please help. I am trying to turn
this
macro into a loop that will go from column c to column r. Now I have the
same
Step copyed over and over again.

For i = 2 To 200 Step 1
e = "c" & i
x = Range(e).Interior.Color
Select Case x
Case 12632256
Range(e).Value = ""
With Range(e).Interior
.Pattern = xlNone
End With
End Select
Next
For i = 2 To 200 Step 1
e = "d" & i
x = Range(e).Interior.Color
Select Case x
Case 12632256
Range(e).Value = ""
With Range(e).Interior
.Pattern = xlNone
End With



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 328
Default Loop Column

Thanks.... I'll try it

"Dana DeLouis" wrote:

Not tested, but any ideas here that could help?

Sub Demo()
Const lColor As Long = 12632256
Dim Cell As Range

For Each Cell In [C2:R200].Cells
If Cells.Interior.Color = lColor Then
Cells.Value = vbNullString
Cells.Interior.Pattern = xlNone
End If
Next Cell
End Sub

--
Dana DeLouis


"Lisa" wrote in message
...
I am new to Macros in Excel can someone please help. I am trying to turn
this
macro into a loop that will go from column c to column r. Now I have the
same
Step copyed over and over again.

For i = 2 To 200 Step 1
e = "c" & i
x = Range(e).Interior.Color
Select Case x
Case 12632256
Range(e).Value = ""
With Range(e).Interior
.Pattern = xlNone
End With
End Select
Next
For i = 2 To 200 Step 1
e = "d" & i
x = Range(e).Interior.Color
Select Case x
Case 12632256
Range(e).Value = ""
With Range(e).Interior
.Pattern = xlNone
End With




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
loop thru column and highlight the rows mariasa Excel Discussion (Misc queries) 1 July 1st 06 08:53 AM
Loop help PaulW Excel Discussion (Misc queries) 0 May 8th 06 04:00 PM
vba loop Jackie Excel Discussion (Misc queries) 4 February 28th 06 04:20 AM
Do Loop Noemi Excel Discussion (Misc queries) 0 December 8th 05 10:43 PM
Loop JohnUK Excel Discussion (Misc queries) 1 February 22nd 05 02:50 PM


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