Link to home
Start Free TrialLog in
Avatar of jrflanagan
jrflanagan

asked on

Combine specified column with user inputted row

How can I take a user inputted row to select a specific cell if the column is specified in the code?

I've got a userform with a TextBox for the user to enter the row number.

Say the column I am interested in is Column A...

If the user inputs "2".....I want to set the output cell to the value in A2
If the user inputs "43"......A43...etc.


Thank you!
Avatar of Tony Barkdull
Tony Barkdull
Flag of United States of America image

Try this

=CONCATENATE("A",A1) where A1 is where the user enters the number
Avatar of jrflanagan
jrflanagan

ASKER

The user will be inputting the value in a userform.....so the value will be stored in sometihng like TextBox1.Value

How can i reference that value?
Try code below:
Dim mRow As Long
    Dim mColumn As Long
    Dim mValue As String
    mColumn = ActiveCell.Column
    If IsNumeric(Me.TextBox1.Text) Then
        mRow = Me.TextBox1.Text
        mValue = Me.TextBox2.Text
        Rows(mRow).Columns(mColumn).Value = mValue
    End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of wchh
wchh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That did it, thank you!