nitrammada
Board Regular
- Joined
- Oct 10, 2018
- Messages
- 78
- Office Version
- 365
- Platform
- Windows
Hi Everyone,
I want an input box to pop up in a VBA If statement asking for a code that should match what is in cell B2 as one of the conditions within the if statement.
This is what I have so far from trial and error and from gleaning what I can from MrExcel forums, but I'm stuck.
Can anyone help? Any suggestions appreciated.
Regard
Adam
I want an input box to pop up in a VBA If statement asking for a code that should match what is in cell B2 as one of the conditions within the if statement.
This is what I have so far from trial and error and from gleaning what I can from MrExcel forums, but I'm stuck.
VBA Code:
Sub UpdateTestL1()
Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveSheet.Unprotect
Application.Calculation = xlCalculationManual
Dim ws As Worksheet, MyRng As Range
Dim lWS_Visible_State As Long
Dim aaa As String
'aaa = Application.InputBox("Enter function for cell B2.")
Set MyRng = Application.InputBox(Prompt:="Enter function for cell B2.")
If ws.Range("A1") = "L1" And ws.Range("B2") = MyRng Then
ws.Range("D6") = "1500000"
End If
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Can anyone help? Any suggestions appreciated.
Regard
Adam