madchemist
Board Regular
- Joined
- Jul 10, 2006
- Messages
- 198
I am wondering if someone could help me with this.
I am trying to bring up an input box to ask the user which row they want to do something in.
Here is what I have so far....
Option Explicit
Public CompletionDate As String, Resources As String, Notes As String
'Sub foo()
' Dim s As Shape
' Dim CompletionDate As String, Resources As String, Notes As String
'
' CompletionDate = InputBox("Which row would you like to close")
' 'Range("D19") = CompletionDate
' Resources = InputBox("What date was it closed?")
' 'Range("F19") = Resources
' Notes = InputBox("Who closed it?")
' 'Range("G19") = Notes
'End Sub
Public Sub CloseItem()
Application.Run "InputMe"
Range("P5").Select
ActiveCell.FormulaR1C1 = Resources
Range("Q5").Select
ActiveCell.FormulaR1C1 = Notes
End Sub
Sub InputMe()
CompletionDate = _
InputBox("Which row would you like to close?")
Resources = _
InputBox("What date was it closed?")
Notes = _
InputBox("Who closed it?")
End Sub
How can I change the 5 in "P5" and "Q5" to be whatever row was input? Or is there a way I can make it so that when a user clicks on a cell in a row it runs this macro on that row? I know you can do it with control checkboxes but dont want to go through all the trouble because there are tons and tons of rows to deal with and I do not want to set it all up. Thanks!
I am trying to bring up an input box to ask the user which row they want to do something in.
Here is what I have so far....
Option Explicit
Public CompletionDate As String, Resources As String, Notes As String
'Sub foo()
' Dim s As Shape
' Dim CompletionDate As String, Resources As String, Notes As String
'
' CompletionDate = InputBox("Which row would you like to close")
' 'Range("D19") = CompletionDate
' Resources = InputBox("What date was it closed?")
' 'Range("F19") = Resources
' Notes = InputBox("Who closed it?")
' 'Range("G19") = Notes
'End Sub
Public Sub CloseItem()
Application.Run "InputMe"
Range("P5").Select
ActiveCell.FormulaR1C1 = Resources
Range("Q5").Select
ActiveCell.FormulaR1C1 = Notes
End Sub
Sub InputMe()
CompletionDate = _
InputBox("Which row would you like to close?")
Resources = _
InputBox("What date was it closed?")
Notes = _
InputBox("Who closed it?")
End Sub
How can I change the 5 in "P5" and "Q5" to be whatever row was input? Or is there a way I can make it so that when a user clicks on a cell in a row it runs this macro on that row? I know you can do it with control checkboxes but dont want to go through all the trouble because there are tons and tons of rows to deal with and I do not want to set it all up. Thanks!