Add new rows after the last active cell based on userform inputs

zack8576

Active Member
Joined
Dec 27, 2021
Messages
271
Office Version
  1. 365
Platform
  1. Windows
I have a form that allows the users to select a GT Size and the quantity
If user select 750, qty of 1, then everything in the yellow rectangle will be added to a csv file that is already open, after the last active row.
if user select qty of 2, then everyting in yellow rectangle will be added to the csv file twice (12 new rows of data)
if user select 1000 Gallon, qty of 2, then everyting in red rectangle will be added to the csv file twice (12 new rows of data)....etc

how to use VBA to achieve this ?

PS: right now all the values in the screenshot are in a database in a xlsb file, which is also where the userform is located.
so the VBA code will just be copying these values from the xlsb to the csv.


1675611678557.png

1675649846383.png
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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