View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_217_] Leith Ross[_217_] is offline
external usenet poster
 
Posts: 1
Default Using the value in the inputbox again


Hello Capuccine,

Store the InputBox result in a variable. Here is your code with the
additions.


Code:
--------------------
Sub Kit1()

Dim Answer
Dim rng As Range
Dim rng1 As Range

Sheets("Sheet1").Select

Set rng = Cells(Rows.Count, "A").End(xlUp)

If Not IsEmpty(rng) Then
If rng.Value = Date Then Exit Sub
Set rng = rng.Offset(1, 0)
End If

rng.Value = Date

Answer = InputBox("How many kits?")
rng.Offset(0, 4). Value = Answer

Sheets("Sheet2").Select

Set rng1 = Cells(Rows.Count, "A").End(xlUp)

If Not IsEmpty(rng) Then
If rng1.Value = Date Then Exit Sub
Set rng1 = rng1.Offset(1, 0)
End If

rng1.Value = Date
rng1.Offset(0, 4). Value = Answer

End Sub

--------------------

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=482369