JDone
10-28-2007, 03:58 PM
I am trying to name a range depending on the user input
But it doesn't seem to name any range
My guess is that it is not recognizing the input, as it is captured correctly.
So the actual sheet has a bunch of names in a row, and i want to match the name from the inputbox to the name in the row and then name the range (data) below it.
Any ideas?
Name= InputBox("Please input a name")
With Worksheets("Names").Range("A1")
For i = 1 To 10
If .Offset(0, i) = " & Name & " Then
Range(.Offset(1, 0), .End(xlDown)).Name = "Name"
End If
Next
End With
But it doesn't seem to name any range
My guess is that it is not recognizing the input, as it is captured correctly.
So the actual sheet has a bunch of names in a row, and i want to match the name from the inputbox to the name in the row and then name the range (data) below it.
Any ideas?
Name= InputBox("Please input a name")
With Worksheets("Names").Range("A1")
For i = 1 To 10
If .Offset(0, i) = " & Name & " Then
Range(.Offset(1, 0), .End(xlDown)).Name = "Name"
End If
Next
End With