Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP w/ Macro and IF Statement
I am needing to have a macro look at a Cell (B8) and determine if it ha a value greater than 0. IF it does I need it to copy the contents t another cell (M8) then move down 4 cells and repete IF the value i "======" then I am done. Can somone PLEASE help me with this -- randy_t ----------------------------------------------------------------------- randy_tn's Profile: http://www.excelforum.com/member.php...fo&userid=1600 View this thread: http://www.excelforum.com/showthread.php?threadid=27471 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to If Statement | Excel Discussion (Misc queries) | |||
macro or if statement | Excel Worksheet Functions | |||
Run Macro From If Statement | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
If-statement in Macro | Excel Programming |