Copy past using VBA [Closed]

Report
Posts
3
Registration date
Sunday November 13, 2016
Status
Member
Last seen
November 17, 2016
-
Posts
2
Registration date
Tuesday November 29, 2016
Status
Member
Last seen
November 30, 2016
-
I am in Excel trying to copy data from from one worksheet to another. The idea is new data would be added to the next row each time data is added. Each row consists of 17 columns. This data need to be copied to another page to a specific row and column.
What Im trying to do is use the input data to create data for a unique label.
Data B5 copy print A3
Data F5 copy print B3
Data F6 copy print C3
Data C7 copy print D3
Data F7 copy print E3
Data C8 copy print G3
Data C9 copy print H3
Data C10 copy print I3
Data C11 copy print J3
Data D12 copy print K3
Data D13 copy print L3
Data D14 copy print M3
Data D15 copy print N3
Data D16 copy print O3
Data D17 copy print P3
Data D18 copy print Q3
Data D19 copy print R3

I have tried to so a record macro all i get is a error

Please help
Bryan

3 replies

Posts
14010
Registration date
Sunday June 8, 2008
Status
Contributor
Last seen
January 23, 2021
4
What error do you get when recording the macro?
Posts
3
Registration date
Sunday November 13, 2016
Status
Member
Last seen
November 17, 2016

I got the record macro to function pas the error.
Now what I need is a way to prompt a user to input the row needed to print.
The some how in the code be able to take the input to assign a specific row
You help is greatly appreciated,
Posts
14010
Registration date
Sunday June 8, 2008
Status
Contributor
Last seen
January 23, 2021
4
Instead of prompting the user, the macro could perhaps print the currently selected row?
Posts
3
Registration date
Sunday November 13, 2016
Status
Member
Last seen
November 17, 2016

YG_BE, Yes that would work. How do I get that to function?
Posts
14010
Registration date
Sunday June 8, 2008
Status
Contributor
Last seen
January 23, 2021
4
If you want to learn how to do that :
1) start recording a macro
2) select a range you want to print
3) print the selection
4) stop recording the macro
5) examine the macro, and use it as an example to code what you want to achieve
Posts
2
Registration date
Tuesday November 29, 2016
Status
Member
Last seen
November 30, 2016

There are a few different ways to accomplish this task, and the macro recorder doesn’t always give you the most efficient VBA code.

In the following three videos I explain:

The most efficient method for a simple copy and paste in VBA.
The easiest way to paste values.
How to use the PasteSpecial method for other paste types.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!