what is the code for using values in an input box as a range

Anthony Williams 1 Reputation point
2022-08-10T23:53:29.437+00:00

Hi everyone I need some code for getting a value from an input box. So i am proposing to use an input box to get a pair of cell values to use as a range. e.g. I5:I13 looked everywhere and can't find anything have on old book on vba but its no longer valid as thing have changed in 12 years or so since I bought it. I'm a bit time poor so I don't have time to try to figure it out and I don't need anything too fancy just simple code that does the job. Thanks in advance

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,251 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Qi You 1 Reputation point
    2022-08-11T03:02:57.67+00:00

    Hi @Anthony Williams
    Based on your question, I would like to ask which method you need to use? If it is ASP.NET WebForm, you can refer to the following my method:
    Default.aspx

    <div>  
    <asp:TextBox ID="Enter1" runat="server"></asp:TextBox>  
    </div>  
     <div>  
    <asp:TextBox ID="Enter2" runat="server"></asp:TextBox>  
    </div>  
    <div>  
    <asp:TextBox ID="TextBox" runat="server"></asp:TextBox>  
    </div>  
    <div>  
    <asp:Button ID="button" runat="server" Text="Button" On Click="Button1" />  
    </div>  
    

    Default.aspx.cs

     public partial class _Default : Page  
            {  
                protected void Page_Load(object sender, EventArgs e)  
                {  
                }  
                public void Button1(object sender, EventArgs e)  
                {  
                    TextBox.Text = "Find range is"+Enter1.Text+":"+Enter2.Text;  
                }  
          
            }  
    

    I enter I5 in the first input box and I13 in the second input box.
    230302-11.png
    After submitting, you will get the following output box display
    230226-22.png
    If you have a method you want to use, you can further explain your needs to help me better solve your problem.

    Best regards,
    Qi You


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments