Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default For Each in VBA

I have the following macro which isn't working:

Sub EachTest()
Dim A As Variant, MyString As String
MyString = "10"
For Each A In Range("A10:A20")
If A.Value = True Then MyString
Next
End Sub

When this is run I get an error: "Compile error. Expected Sub,
Function or Property."

I'm trying to replace TRUE values in A10:A20 with the number 10 and
ignore the FALSE values.

Presumably I'm missing something simple here.

Thanks,

Dave

 
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



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