View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Loop excel formula

Dim myRng as range
dim myCell as range

with worksheets("sheet9999")
set myrng = .range("a1:D1")
end with

for each mycell in myrng.cells
if mycell.value = "hi" then
msgbox "It said hi!"
else
msgbox "No it didn't"
end if
next mycell



magix wrote:

Hi,

I need to loop through
A1, B1, C1, D1
- then do some IF checking

Is there a FOR excel formula ? Or is there a better way ?

Thanks.


--

Dave Peterson