Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Data Input

0

I made a custom Data Input table on Sheet 1 .The Range is $A$3:$N$20. I looks just like an Invoice. So when i get an Invoice i add the expenses to that Data Input table. After i'm done i would like to hit a submit Button that would add the Data to Another Sheet Named Source data(Sheet2).  Column A(Date), Column B (Part#) Column C (Description) .Tried uploading the Excel File but it doesn't seem to work.Must not be doing something right.

Answer
Discuss

Discussion

You need to explain exactly what you are trying to do and what the issue is. As of now, I'd tell you to set Calculation Options on the Formulas tab to Automatic and see if that helps. But, you really haven't made anything clear at all. Edit your question and upload a sample file that illustrates what you are trying to do.
don (rep: 1989) Dec 4, '17 at 5:23 pm
The "Add Expense" form would be a custom form, not a part of normal Excel. To answer your question one would need to know how it works. One might find out how it works by looking at it. However, it might be designed to prevent precisely that. To find out, post a copy of your workbook.. Remove sensitive data and private information, then attach it to your original question.
Variatus (rep: 4889) Dec 4, '17 at 8:15 pm
I uploaded the copy of the workbook. All i'm trying to do is, when i enter the invoice data onto this custom form,I wanna be able to hit the submit button. Then it will copy it to the Source Data Sheet(Table).
Learn (rep: 2) Dec 6, '17 at 8:48 pm
Add to Discussion

Answers

0
Selected Answer

Your code couldn't run because it is in another file, apparently one you downloaded. In the attached workbook the two buttons are now working with code which is located in the same workbook. They do what you want.

You will find it in the code module 'DataInput' as well in the code sheet of the worksheet 'Sheet1 (AddExpense)'. Please read the comments I added to this code so that you understand the functionality I added. Simply said, I removed the existing formula-based automation of date entry and total calculation (except in the grand total) and replaced it with VBA based automation. To limit this automation I inserted a named range "Invoice" (A3:N20). I removed the existing 'Table2' in the Source Data sheet because it interfered with the copying process.

Note that the cell formats will be copied from the 'Add Expense' sheet along with the data. Good luck!

Discuss

Discussion

Thanks a million. It works exactly  like i wanted. Thank-You
Learn (rep: 2) Dec 8, '17 at 6:31 pm
Add to Discussion
0

You could put this formula into cell A3 on the Source Data sheet:

=IF(NOT(ISBLANK('Add Expense'!A3)),'Add Expense'!A3,"")

Then copy it over to your other columns and down your rows.

This formula will create an exact copy of the line-items on the Add Expense worksheet.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login