patricknord
New Member
- Joined
- Apr 1, 2013
- Messages
- 5
Hi,
I am trying to write a script that will return multiple actions if a condition is true--I wrote this and it is not working:
Sub test()
Dim currcell, mycell As Range
Set currcell = ActiveCell
Set mycell = Sheets("sheet2").Range("c5")
If (mycell.Value = Empty) Then mycell.Value = currcell And Sheet2.Cells(mycell.Row, mycell.Column + 1).Value = Sheet1.Cells(currcell.Row, currcell.Column + 1) _
Else: If (mycell = currcell) Then Sheet2.Cells(mycell.Row, mycell.Column + 1).Value = Sheet1.Cells(currcell.Row, currcell.Column + 1) * 2
End Sub
What do I need to change??
I am trying to write a script that will return multiple actions if a condition is true--I wrote this and it is not working:
Sub test()
Dim currcell, mycell As Range
Set currcell = ActiveCell
Set mycell = Sheets("sheet2").Range("c5")
If (mycell.Value = Empty) Then mycell.Value = currcell And Sheet2.Cells(mycell.Row, mycell.Column + 1).Value = Sheet1.Cells(currcell.Row, currcell.Column + 1) _
Else: If (mycell = currcell) Then Sheet2.Cells(mycell.Row, mycell.Column + 1).Value = Sheet1.Cells(currcell.Row, currcell.Column + 1) * 2
End Sub
What do I need to change??