ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If Statement (https://www.excelbanter.com/excel-worksheet-functions/5552-if-statement.html)

randy_tn

If Statement
 

I am needing to have a macro look at a Cell and (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. 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=274679


merlin


"randy_tn" schreef in bericht
...

I am needing to have a macro look at a Cell and (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. 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=274679


Public Sub Test()
Dim wb As Workbook, ws As Worksheet
Set wb = ThisWorkbook
Set ws = wb.ActiveSheet
ws.Cells(8, 2).Select
If Val(Selection) 0 Then
ws.Cells(8, 13).Value = Selection
End If
ws.Cells(12, 2).Select
If Selection = "======" Then
'You're done
Exit Sub
Else
'Code here
End If
End Sub




All times are GMT +1. The time now is 06:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com