Macro to detect row number and generate report

fabriciofcmiranda

Board Regular
Joined
Jun 27, 2006
Messages
62
Hi, everyone.

I need one more help. I have a workbook where I insert all the expenses of my department. Each expense goes into one row. On each row, I have information such as name of vendor, due date, amount, etc., for each of the expenses.

The fact is that I need to generate a report when I insert a new expense, with all the information about it, because the manager of the respective area needs to sign the expense aproval before it's sent to the financial department. Until today, I've been just copying each information and pasting it into another sheet, that is formated as a report (with the signature field and all). But I've been seeing such amazing things that you guys do here that I started asking myself if there's a way to automate these reports.

My idea is:
1. I insert a new row for a new expense (I already have the code for that);
2. I put in all the information about the expense;
3. I push a button to generate a report;
4. The macro asks me to select the row where the information that's going to be on the report is;
5. I select the row;
6. The macro gets the information on each collumn of that row and pastes it into the right area of the report sheet;
7. I print out the report sheet.

Is this the smartest way to do it?

Thank you guys so much for your help in advance!

Best regards,
Fabricio Miranda
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,225,608
Messages
6,185,960
Members
453,333
Latest member
BioCoder84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top