• 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.

Make a Form in Excel

a_dani20

New Member
Hi frnds..

I want to prepare a excel sheet in which i want to enter some records. There are two sheets one for data entry ( named 'source') and other containing all the data entered ( named 'master') . Now what i want is as soon i enter data in source sheet and press enter or some other trigger, the data should automatically get added to master file and field for data entry in source sheet becomes blank so that next data can be entered.
 
Insert a button from Develepor tab and then hit "New"

which will take you to VBE (Visual Basic Editor). here paste the code below:

[pre]
Code:
Sheets("source").Activate
Range("A2").Select 'assuming you have headers in column 1
Range(selection, selection.End(xlToRight)).Select
Range(selection, selection.End(xlDown)).Select
rcount = Sheets("master").Range("A65536").End(xlUp).Offset(1, 0).Row
selection.Copy Sheets("master").Range("A" & rcount)
selection.ClearContents
[/pre]
 
if the data in your columns can have blanks, then use

[pre]
Code:
Sub Master()
Sheets("source").Activate
Range("A2:X2").Select 'assuming your data is from A to X - you can change this
Range(selection, selection.End(xlDown)).Select
rcount = Sheets("master").Range("A65536").End(xlUp).Offset(1, 0).Row
selection.Copy Sheets("master").Range("A" & rcount)
selection.ClearContents
End Sub
[/pre]
 
Back
Top