Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50327

Putting values from userform into specific location on spreadsheet.

$
0
0
I have two textbox's that the user enters values into. I want the first textbox value to be put into the last column of a specific spreadsheet. I want the second textbox value to be put into the cell immediately below that cell. Currently, I have:
Code:

    If OptionButton1.Value = True Then
        With Sheets("Metallize")
       
        LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Address
        RowNum = .Cells(Rows.Count, LastCol).End(xlUp).Offset(1, 0).Row
       
        'Adds Customer
        Cells(1, LastCol) = TextBox1.Text
       
        'Adds Part Number
        Cells(RowNum, LastCol) = TextBox2.Text
        End With
    End If
    Unload Me

Does anyone know what I am doing wrong?

Viewing all articles
Browse latest Browse all 50327

Latest Images

Trending Articles



Latest Images