How copy certain cell values to a new worksheet with a command button on the original worksheet

I am not an Excel expert believe me.  But I am trying to figure out how to copy certain cell values to a new worksheet with a button on the original worksheet.  For example, I may want cell B2 on the original to copy over to A1 on the new worksheet.  And B3 to copy to A2, B5 to A3, B17 to A4, etc.

At the same time I will want to new worksheet tab to be named "Member Import"

Can this be done?
SteveL13Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Is there a limit to the number of cells you might want to copy?
SteveL13Author Commented:
I believe there are approximately 35.  But in the original tab they are not all together.  Some are, but not all.
Martin LissOlder than dirtCommented:
Are they always the same?
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Saurabh Singh TeotiaCommented:
Here is the sample code for your reference which you can use to do what you are looking for this will copy data from sheet1 to Member import in the cells that you mentioned..feel free to add more lines to this code to do what you are looking for..

Sub copydata()
Dim ws As Worksheet
Dim ws1 As Worksheet
Set ws = Sheets("Sheet1")

Set ws1 = Sheets("Member Import")

ws.Range("B2:B3").Copy ws1.Range("A1")
ws.Range("B5").Copy ws1.Range("A3")
ws.Range("B7").Copy ws1.Range("A4")
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveL13Author Commented:
Martin, yes, they will always be the same.
Saqib Husain, SyedEngineerCommented:
If you know how to set up a button with a macro the you can call this macro from there
This will create a new worksheet with the desired name and copy the values without changing the format of the new worksheet

Sub copy2new()
Dim sws As Worksheet
Dim tws As Worksheet
Set sws = ActiveSheet
Set tws = ActiveWorkbook.Worksheets.Add
tws.Name = "Member Import"
tws.Range("B2").Value = sws.Range("A1").Value
tws.Range("C4:D5") = sws.Range("A2:B3").Value
sws.Activate
End Sub
Martin LissOlder than dirtCommented:
Here's how to add the macro,

In Excel, Press Alt+F11 to open the Visual Basic Editor (VBE)

Right-click on your workbook name in the "Project-VBAProject" pane (at the top left corner of the editor window) and select Insert -> Module from the context menu

Copy the macro and paste it into the right-hand pane of the VBA editor ("Module1" window)

Press Alt+F11 again to go back to Excel

Optionally, press Alt+F8 to open the "Macro" dialog window. Select the macro, click ‘Options…’,  hold down the Shift key and type the letter A (or any other letter) and click ‘OK’.  Then anytime you want to run the macro press Ctrl+Shift+A
Martin LissOlder than dirtCommented:
You can also of course add a command button to the sheet, right-click on it, and the assign the macro to it.
Rob HensonFinance AnalystCommented:
Is there some way of determining which cells on the source sheet are to be copied?

If you were to apply a filter to show only the required cells what would the criteria be? Is there something in common with those cells?

The filter could be done with either AutoFilter or Advanced Filter. AutoFilter will filter in place and then a selection can be copied; an Advanced Filter can be set to copy to another sheet. Both can be automated using a Macro with a button to run it.

Thanks
Rob H
SteveL13Author Commented:
To all experts... I am still evaluating the recommendations.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.