Hello,
I have a question on how to remember or pass the place where the user doubleclicks. I am trying to make a form show up when a certain range is chosen. For now this range is static, but it will be dynamic in the future. Once the user double clicksa cell in this range, the form pops up.
.
Is there a way to pass the "Target" variable to the form?
This is a partial code of what I have in the form. I used "cell(1,1)" as a place holder, but I want to have a variable as a target or range that knows where the user double clicked. So it changes only that current cell.
I have a question on how to remember or pass the place where the user doubleclicks. I am trying to make a form show up when a certain range is chosen. For now this range is static, but it will be dynamic in the future. Once the user double clicksa cell in this range, the form pops up.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(Target, Range("M4:AF23")) Is Nothing Then
Cancel = True
InputFrm.Show
End If
End Sub
Is there a way to pass the "Target" variable to the form?
This is a partial code of what I have in the form. I used "cell(1,1)" as a place holder, but I want to have a variable as a target or range that knows where the user double clicked. So it changes only that current cell.
Code:
Private Sub CommandButton2_Click()
Dim ColorChosen As String
Dim WordChosen As String
ColorChosen = ColorCmb.Value
WordChosen = LetterCmb.Value
If ColorChosen = "White" Then
Selection.Interior.Pattern = xlNone
If WordChosen = "NA" Then
'cells(1,1) should be changed in the future to save or pass user's range.
Cells(1, 1).Value = "NA"
ElseIf WordChosen = "NS" Then
Cells(1, 1).Value = "NS"
ElseIf WordChosen = "IP" Then
Cells(1, 1).Value = "IP"
ElseIf WordChosen = "C" Then
Cells(1, 1).Value = "C"
ElseIf workdchosen = "A" Then
Cells(1, 1).Value = "A"
End If
End Sub