• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

write down values from txtbox into spreadsheet

tomanton

New Member
Hi all,
Can anyone help me with creating a simple VBA code to copy down values from single txtbox in userform onto spreadsheet column I where a range in that column would be equal to COUNTA($A$4:$A$23), depending on how many cells have been completed on column A.
thank you
 
Does this help with the syntax?
Code:
'Using default names
'Info is going into col J, at same row as last data in col A
With Worksheets("Sheet1")
    .Cells(.Cells(.Rows.Count, "A").End(xlUp).Row, "I") = UserForm1.TextBox1.Value
End With
 
Luke, thanks for your replay. I may have been not clear enough:
so I need column "I" to automatically fill down as many rows as there are filled in column A
so if a user uses A4:A15 so data in column "I" should be filled down I4:I15.
 
Ah. This will fill in Col I wherever there is a constant value in col A.
Code:
Sub Fill()
Range("A:A").SpecialCells(xlCellTypeConstants).Offset(0, 8).Value = UserForm1.TextBox1.Value
End Sub
 
Back
Top