Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
MIKE H i need more help
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mike H - Help | Excel Worksheet Functions | |||
F.A.O Mike H | Excel Discussion (Misc queries) | |||
Help!!! MIKE H | Excel Discussion (Misc queries) | |||
FOR MIKE H. | New Users to Excel | |||
Mike | Excel Discussion (Misc queries) |