View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Phil Webb Phil Webb is offline
external usenet poster
 
Posts: 8
Default HELP w/ Macro and IF Statement

Something like this should be close to what you're looking for. You didn't
state whether or not the copied values will be copied into column M in the
same row as the original value in column B, but I made that assumption.
The loop below will terminate if either the cell value contains the string
"======" (6 equal signs bounded by double quotes) or the cell is empty.

Regards,
Phil Webb

Sub CopyPositiveVals()
Dim cel As Range

Set cel = Range("B8")
Do
If cel.Value 0 Then
Cells(cel.Row, 13).Value = cel.Value
End If
Set cel = cel.Offset(4, 0)
Loop Until cel.Value = Chr(34) & "======" & Chr(34) Or IsEmpty(cel)End
Sub


"randy_tn" wrote in message
...

I am needing to have a macro look at a Cell (B8) and determine if it has
a value greater than 0. IF it does I need it to copy the contents to
another cell (M8) then move down 4 cells and repete IF the value is
"======" then I am done.

Can somone PLEASE help me with this?


--
randy_tn
------------------------------------------------------------------------
randy_tn's Profile:

http://www.excelforum.com/member.php...o&userid=16001
View this thread: http://www.excelforum.com/showthread...hreadid=274716