View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default MIKE H i need more help

April,

Somewhere in your code it sounds like you have OPTION EXPLICIT set so you
need to dim C Like this

Sub loopthrough()
Dim C as range
Dim MyRange As Range
Set MyRange = Range("T225:T234")
For Each c In MyRange
If c.Value = "General Research" Then
c.Offset(0, 15).Value = "MIT0000"
End If
Next
End Sub


Mike

"April" wrote:

i posted a question regarding moving from active cells in a macro on 10/15.
Mike T replied and gave me the following macro to try
Try this

Sub loopthrough()
Dim MyRange As Range
Set MyRange = Range("T225:T234")
For Each c In MyRange
If c.Value = "General Research" Then
c.Offset(0, 15).Value = "MIT0000"
End If
Next
End Sub
i interpreted the c to mean cell and typed that into my macro. however, i
get a message that the "c" in line 3 is an undefined variable.

please help.

thanks in advance
--
BDW