SebastianWidjaja
New Member
- Joined
- Mar 21, 2018
- Messages
- 10
Hey guys,
I just need a small help here, I have a set of code that is 90% ready, it is very simple code. However, the problem is I want to add an "If" statement when the button is pressed and it meets a certain condition, a message box will pop up automatically after the button is pressed. At the moment, I am looking for a code for if button has been clicked with a specific condition.
Above is my code now. What I want is when cell N8 is filled and you pressed the button (in this case I assigned this Copy code to my Copy Button) a message box will pop up. I do not know what to add after "And".
Thanks in advanced!
I just need a small help here, I have a set of code that is 90% ready, it is very simple code. However, the problem is I want to add an "If" statement when the button is pressed and it meets a certain condition, a message box will pop up automatically after the button is pressed. At the moment, I am looking for a code for if button has been clicked with a specific condition.
Code:
[LEFT][COLOR=#333333][FONT=monospace]Sub Copy()
If [N2] = Empty Then
[N2] = [D39]
Else
Range("P" & Rows.Count).End(xlUp).Offset(1) = [D39]
End If
If [N8] <> "" And Then
MsgBox "Please Press Reset Button", vbCritical, "Error"
End If
End Sub[/FONT][/COLOR][/LEFT]
Above is my code now. What I want is when cell N8 is filled and you pressed the button (in this case I assigned this Copy code to my Copy Button) a message box will pop up. I do not know what to add after "And".
Thanks in advanced!