Moving down cells

noobieexcel

New Member
Joined
Oct 23, 2006
Messages
28
Hi all,

May I know the maco code for moving automatically moving down a cell after you have input some data via userform? In this way, I can input data on my userform and the data all appear on different cells.
 

Some videos you may like

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

How's this for a start:

<font face=Tahoma><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> CommandButton1_Click()
    <SPAN style="color:#00007F">Dim</SPAN> LastRow <SPAN style="color:#00007F">As</SPAN> Range
        <SPAN style="color:#00007F">Set</SPAN> LastRow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp)
        LastRow.Offset(1) = TextBox1.Value
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

You'll get a less ambiguous answer if you give some more specifics, like the range, what User Form controls you have and what's the trigger to copy.

HTH,

Smitty
 

noobieexcel

New Member
Joined
Oct 23, 2006
Messages
28
Thanks,

Basically users need to input some text on a textbox (on the userform),
then exel will pick it and display on a cell. (A1)
Thereafter, if another user input some text on the textbox, the information will display on the next cell. (A2)

Please kindly advise
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi,

Smitty's code will do what you asked
did you try it ?

on your userform you need
a textbox TextBox1
a commandbutton CommandButton1

sheet Sheet1 will be affected
change all names (blue) to your suits

kind regards,
Erik
 

noobieexcel

New Member
Joined
Oct 23, 2006
Messages
28

ADVERTISEMENT

thanks alot for all the help!
 

noobieexcel

New Member
Joined
Oct 23, 2006
Messages
28
Hi,

Smitty's code will do what you asked
did you try it ?

on your userform you need
a textbox TextBox1
a commandbutton CommandButton1

sheet Sheet1 will be affected
change all names (blue) to your suits

kind regards,
Erik

Hi, how about if I want the data to display on multiple columns, eg A1, B1, C1, then A2, B2, C2, and so on??

Please help! Thank you so much!
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
how about if I want the data to display on multiple columns, eg A1, B1, C1, then A2, B2, C2, and so on??

Just change the Offset part accordingly:

Offset(Rows,Columns)

I.E. .Offset(1,1) will offset 1 row down, 1 column to the right.

Smitty
 

noobieexcel

New Member
Joined
Oct 23, 2006
Messages
28
how about if I want the data to display on multiple columns, eg A1, B1, C1, then A2, B2, C2, and so on??

Just change the Offset part accordingly:

Offset(Rows,Columns)

I.E. .Offset(1,1) will offset 1 row down, 1 column to the right.

Smitty

Thank you! It works really fine!
 

Watch MrExcel Video

Forum statistics

Threads
1,113,809
Messages
5,544,419
Members
410,610
Latest member
renatha prado
Top