Macro: Copying/Pasting a single row of variables to the next free row in a second spreadsheet

Beastlybeast

New Member
Joined
Oct 3, 2013
Messages
1
Good afternoon ladies and gents, I would very much appreciate some help with a macro. I've never used them before so I'm completely useless with VBA, but more than willing to learn. Problem explained below:

I have two spreadsheets - one is a type of calculator, whilst the other records some bits of output information resulting from the calculator.

The calculator has a drop-down box to choose a number between 1-25. Changing the number pulls in the correct data for that particular observation, which is then solved and output values reported elsewhere in the sheet.

What I want the macro to do is to copy these few output cells into the next free row on the second spreadsheet. I will then go back to the calculator, change the drop-down box to the next observation, solve to get the next set of output values, then copy and paste these into the subsequent free row, and generally rinse and repeat until all 25 observations have their outputs listed in the second file, one after another.

I'm fine with creating a button and assigning a macro to that button, but what the macro should say has me lost.

Any advice on how I might go about this would be very welcome, so many thanks in advance!

Beastlybeast
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
hello beastlybeast
welcome to the board

try the following to see if its what you want
you may need to change the cell references to suit

Sub Sheet2_Button1_Click()
Dim a As Variant
Sheets("sheet1").Range("a1:j1").Copy
If IsEmpty(Range("a1")) Then
Range("a1:j1").PasteSpecial xlPasteValues
Else
Range("a" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Sheets("sheet1").Application.CutCopyMode = False
End If
End Sub
good luck

kevin
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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