VBA: copy and paste in horizontal

Nelson78

Well-known Member
Joined
Sep 11, 2017
Messages
526
Office Version
  1. 2007
Hello everybody.

I'm struggling with a database in which some data (in the example, names of cities) could be repeated a lot of times.

I need to report in another sheet the data, and then report in horizontal the related datas.

See what I mean in the image https://imgur.com/a/HMMWHae


I have succeed in copy and paste the first column without duplicates. Now I need some hints to complete the job, atleast in what sort of approach is needed.

Thank's.
 
In what way?

The source sheet has the following formats:
COLUMN A: general
COLUMN B: date
COLUMN C: general

At the end of the operation, all the data moved in the receiving sheet have format "general" (so, what was "date" in column B of the source, become "general").
If possible, in the receiving sheet I need general what was general, and date what was date.
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try adding this line to the end of the code
Code:
Range("D:D,F:F,H:H").NumberFormat = "dd/mm/yyyy"
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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