Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 111
Default 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   Report Post  
Posted to microsoft.public.excel.misc
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

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
Mike H - Help Tia Excel Worksheet Functions 11 December 17th 08 09:21 PM
F.A.O Mike H leerem Excel Discussion (Misc queries) 3 December 10th 08 01:20 PM
Help!!! MIKE H Wu Excel Discussion (Misc queries) 3 November 9th 08 05:41 PM
FOR MIKE H. doss04 New Users to Excel 5 October 12th 08 12:45 PM
Mike Window Menu Missing Excel Discussion (Misc queries) 6 March 15th 05 03:49 PM


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