Avatar of Jase Alexander
Jase AlexanderFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Excel VB to paste data from one sheet to another

HI Guys

Hope you can help

Can you help with some code that will paste the values in a column from one sheet to another as such:-

Sheet 1 Column A contains data from cell A1 to A500 (lets say names)
in Sheet 2 if I highlight column A - is there some code I can attach to a button that when clicked will paste the data from Sheet 1 Column A into Sheet 2 Column A ?

I can upload a sample if needed but Im sure you guys can help out

Thanks as always

J
Microsoft Excel

Avatar of undefined
Last Comment
Martin Liss
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Do you want it to copy the selected column or always column A?
Avatar of Jase Alexander

ASKER

HI Martin

The user will highlight the column in sheet 2 (if they have to unless the code can do this without the need for highlighting) - then the corresponding button (with connecting code) can be clicked - labelled for example COLUMN A - then the data from Sheet 1 will copy into Sheet 2.

I have attached the actual sheet - in this case the Sheet 1 in question is Re_Shuffle and Sheet 2 is Formatting.

Ive done a dummy set up in the Formatting sheet to show what I need pasted in after the buttons are pressed.

Hope you can help

Many Thanks
J
FedExInvoiceExport_WIP_Copy-of-53301.xls
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

I don't know if EE is having a problem or what is going on because when I try to download your xls file, it is being treated like a URL and I get a 404 error. If you like you can send the workbook to in an ee message or to the email address you'll find in my profile.
Avatar of Jase Alexander

ASKER

Hi Martin

Did you get the attachment ?

J
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

I replied to your message. What I said was that I still get the 404 error when trying to open it and I asked if you used the Attach File icon that's below this area when you create a post.
Avatar of Jase Alexander

ASKER

Hi Martin

Apologies my mobile does not let me see message replies for some reason

Will try reposting the example on the attachment option below

Many thanks

J
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Don't see anything yet.
Avatar of Jase Alexander

ASKER

Hi Martin

Apologies for the delay

I have attached a simplified version of the example - hope this works

To answer your question its not always column A to be pasted into Sheet 2 - each button will relate to a specific column in sheet 1 to paste into Sheet 2

Hope this helps and subsequently hope you can help

J
SheetExample.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Jase Alexander

ASKER

Superb !!

Thanks Martin for your help

It works a treat

J
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.

Marty - MVP 2009 to 2015
              Experts Exchange MVE 2015
              Experts-Exchange Top Expert Visual Basic Classic 2012 to 2015
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo