Leviathan87
New Member
- Joined
- Mar 2, 2022
- Messages
- 4
- Office Version
- 2013
- Platform
- Windows
I am applying a small part of my code!I have a code with two variable Value1 and Value2 and input box. I want if input number 1 or number 2 the code show me Value1 or if i press number 2 show me Value2
Sub Inputbox()
Dim Name As String
Dim LastRow As Long
Dim Value1 As String
Dim Value2 As String
Value1 = 807063
Value2 = 807059
Name = Application.InputBox("Please Select 1 To 2" & vbLf & vbLf & "1 - 807063 - " & vbLf & "2 - 807059 ", "Enter a value")
If Name = TRUE Then
LastRow = Cells(Rows.Count, "C").End(xlUp).Row + 1
lastRow = lastRow = Cells(Rows.Count, "C").End(xlUp).Row + 1
Range("C" & LastRow).Value = Value1
Else: Value2 = LastRow = Cells(Rows.Count, "C").End(xlUp).Row + 1
lastRow1 = lastRow1 = Cells(Rows.Count, "C").End(xlUp).Row + 1
Range("C" & LastRow).Value = Value2
End If
Exit Sub
Sub Inputbox()
Dim Name As String
Dim LastRow As Long
Dim Value1 As String
Dim Value2 As String
Value1 = 807063
Value2 = 807059
Name = Application.InputBox("Please Select 1 To 2" & vbLf & vbLf & "1 - 807063 - " & vbLf & "2 - 807059 ", "Enter a value")
If Name = TRUE Then
LastRow = Cells(Rows.Count, "C").End(xlUp).Row + 1
lastRow = lastRow = Cells(Rows.Count, "C").End(xlUp).Row + 1
Range("C" & LastRow).Value = Value1
Else: Value2 = LastRow = Cells(Rows.Count, "C").End(xlUp).Row + 1
lastRow1 = lastRow1 = Cells(Rows.Count, "C").End(xlUp).Row + 1
Range("C" & LastRow).Value = Value2
End If
Exit Sub