Hi all!
I have a question related to a macro.
What do i want: if someone enters data in a userform, this information should be inserted in a worksheet. In this worksheet, D2, D3 and D4 are filled with text. The data inserted in the userform should come in E2, E3 and E4, the next time the inserted information should come next to this, (so F2, F3 and F4), the next time, in the column next to it...
Some codes I have found but which are not working:
Code to go to the cell right to the last one used (works):
Range("IV2").End(xlToLeft).Offset(0, 1).Select
Code I tried, but the information inserted gets in the wrong columns:
emptyColumn = WorksheetFunction.CountA(Range("7:7"))
Cells(2, emptyColumn).Value = TextBox1.Value
Cells(3, emptyColumn).Value = TextBox2.Value
Cells(4, emptyColumn).Value = TextBox3.Value
Something automatic I found but not working:
Dim rNextCl As Range
Set rNextC = ActiveSheet.Range("av1").End(xlToLeft).Offset(0, 1)
rNextCl.Value = Me.TextBox1.Value
rNextCl.Offset(1, 0).Value = Me.TextBox2.Value
rNextCl.Offset(1, 0).Value = Me.TextBox3.Value
Thanks a lot for helping me out!!!
I have a question related to a macro.
What do i want: if someone enters data in a userform, this information should be inserted in a worksheet. In this worksheet, D2, D3 and D4 are filled with text. The data inserted in the userform should come in E2, E3 and E4, the next time the inserted information should come next to this, (so F2, F3 and F4), the next time, in the column next to it...
Some codes I have found but which are not working:
Code to go to the cell right to the last one used (works):
Range("IV2").End(xlToLeft).Offset(0, 1).Select
Code I tried, but the information inserted gets in the wrong columns:
emptyColumn = WorksheetFunction.CountA(Range("7:7"))
Cells(2, emptyColumn).Value = TextBox1.Value
Cells(3, emptyColumn).Value = TextBox2.Value
Cells(4, emptyColumn).Value = TextBox3.Value
Something automatic I found but not working:
Dim rNextCl As Range
Set rNextC = ActiveSheet.Range("av1").End(xlToLeft).Offset(0, 1)
rNextCl.Value = Me.TextBox1.Value
rNextCl.Offset(1, 0).Value = Me.TextBox2.Value
rNextCl.Offset(1, 0).Value = Me.TextBox3.Value
Thanks a lot for helping me out!!!