Moving data from sheet1 to sheet2, increment rows

pschwind

New Member
Joined
Apr 23, 2007
Messages
21
Ok, let’s see if I can articulate this well.

I have two worksheets in excel. The first sheet allows a user to answer some questions and performs a single calculation. If the calculation is acceptable to the user, I want them to be able to click a button and send the data from two different cells (A2 and C18 to be exact) on worksheet1 over to the worksheet2.

I want worksheet2 to have two columns, one for the value from A2 and one for the value from C18.The person may perform the calculation on worksheet1 several times. Each time they do that calculation and click the button, I would like to save the A2 and C18 cell data in a new row on worksheet2. Worksheet2 could have many rows of data that were the from the calculations on worksheet1.

Does that make sense?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hello,

do you mean this?

Code:
Sub sheet1_to_sheet2()
    With Sheets("Sheet1")
        .Range("A2").Copy Sheets("SHeet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
        .Range("C18").Copy Sheets("SHeet2").Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
    End With
End Sub

or if you want the values only, is A2 and C18 are formula try

Code:
Sub sheet1_to_sheet2()
    With Sheets("Sheet1")
        .Range("A2").Copy
        Sheets("SHeet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial (xlValues)
        .Range("C18").Copy
        Sheets("SHeet2").Range("B" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial (xlValues)
    End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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