Hi,
I am using a Inputbox to ask the user where they would like to insert a line on a sheet in order to add missing info. Is there a way to let the user scroll through the sheet before they enter in the row number in the inputbox? Right now when the inputbox in up, the user can't scroll at all, is this possible with additional code or is there any alternative?
Here's the code if that helps...
Sub InputTest()
Dim r, n
Range("A14:A248"
.Select
ActiveWorkbook.Names.Add Name:="MergePurgeKeyCodes", RefersToR1C1:= _
"='Merge Purge Report'!R14C1:R248C1"
Range("A14"
.Select
'------------------------------------------------------
Set r = Range("MergePurgeKeyCodes"
For n = 1 To r.Rows.Count
If r.Cells(n, 1) <> r.Cells(n, 15) Then
Dim Message, Title, Default, MyValue
'Need to add value of cell in column A -the keycode that is missing, to the message
Message = "Enter The Row #, In The Flax Sheet, That You Want To Insert A New Row Over To Include this keycode: " & " " & r.Cells(n, 1) ' Sets prompt
Title = "Found A Missing Keycode In Flax Sheet" 'Sets Title
Default = "1" 'sets default value.
'Display message, title and default value.
MyValue = InputBox(Message, Title, Default, 100, 100)
If MyValue = "" Then 'exits out of function if user clicks on cancel
Exit For
End If
Worksheets("Test Sheet"
.Rows(MyValue).Insert 'change sheet name later to real name
End If
Next n
End Sub
Any suggestions would be very appreciated, thanks.
Andre
I am using a Inputbox to ask the user where they would like to insert a line on a sheet in order to add missing info. Is there a way to let the user scroll through the sheet before they enter in the row number in the inputbox? Right now when the inputbox in up, the user can't scroll at all, is this possible with additional code or is there any alternative?
Here's the code if that helps...
Sub InputTest()
Dim r, n
Range("A14:A248"
ActiveWorkbook.Names.Add Name:="MergePurgeKeyCodes", RefersToR1C1:= _
"='Merge Purge Report'!R14C1:R248C1"
Range("A14"
'------------------------------------------------------
Set r = Range("MergePurgeKeyCodes"
For n = 1 To r.Rows.Count
If r.Cells(n, 1) <> r.Cells(n, 15) Then
Dim Message, Title, Default, MyValue
'Need to add value of cell in column A -the keycode that is missing, to the message
Message = "Enter The Row #, In The Flax Sheet, That You Want To Insert A New Row Over To Include this keycode: " & " " & r.Cells(n, 1) ' Sets prompt
Title = "Found A Missing Keycode In Flax Sheet" 'Sets Title
Default = "1" 'sets default value.
'Display message, title and default value.
MyValue = InputBox(Message, Title, Default, 100, 100)
If MyValue = "" Then 'exits out of function if user clicks on cancel
Exit For
End If
Worksheets("Test Sheet"
End If
Next n
End Sub
Any suggestions would be very appreciated, thanks.
Andre