If Statement

R

randy_tn

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

Can somone PLEASE help me with this
 
M

merlin

randy_tn said:
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?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top