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



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
Macro to If Statement JHusker Excel Discussion (Misc queries) 7 October 10th 08 10:39 PM
macro or if statement CHARI Excel Worksheet Functions 2 December 8th 06 08:56 PM
Run Macro From If Statement Paige Excel Discussion (Misc queries) 2 June 2nd 05 10:37 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
If-statement in Macro fabalicious[_26_] Excel Programming 0 October 8th 04 09:16 AM


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