Copying and Moving Portions of a Range

travislr11

New Member
Joined
Jan 20, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello All, I recently went through a course trying to learn VBA and picked up some understanding of the language but having trouble with a project I am attempting to solve. I want to expedite organizing data for two statistical software that I use. One requires the entire data collected for a trial to be organized in a vertical layout continuously until the end of the trial. While the other requires data from each rating data to be in a vertical format but separated by each rating date and progress horizontally or across the columns. I use both software regularly because each does different things so I am trying to build a macro that will copy portions of a continuous range based on a condition and paste only the values in close proximity by the date the data was collected with headers. I was using a start row and last row variables to establish a dynamic range and then build a for each loop based on a condition by either the rating date or plot # but was not having much success. So essentially saying if this condition is or is not met, do this until it is met, then offset a certain number of columns to begin copying and pasting the next block of data. I attached the final product in the form of two mini sheets so visually you can see what it would look like if a macro were to run properly on this set of data. Any help is appreciated.

ARM Data Organization Macro.xlsm
ABCDEFGHIJ
4
5
6All Data Needs To Go Below This Header, With Plot #'s Being the First Column and Headers Starting in Cell A8
7
8Plot #DateBP % TQTC
9101Jun 15 202107.57
10102Jun 15 202107.57
11103Jun 15 202107.57
12104Jun 15 202107.57
13105Jun 15 202107.57
14201Jun 15 2021077
15202Jun 15 202107.57
16203Jun 15 2021077
17204Jun 15 2021077
18205Jun 15 2021077
19301Jun 15 202107.57
20302Jun 15 2021577
21303Jun 15 2021077
22304Jun 15 2021077
23305Jun 15 202107.57
24401Jun 15 202107.57
25402Jun 15 2021077
26403Jun 15 2021077
27404Jun 15 2021077
28405Jun 15 202107.57
29101Jun 29 202156.57
30102Jun 29 202156.57
31103Jun 29 2021077
32104Jun 29 2021077
33105Jun 29 202107.57
34201Jun 29 2021277
35202Jun 29 2021077
36203Jun 29 2021077
37204Jun 29 2021277
38205Jun 29 2021106.57
39301Jun 29 2021277
40302Jun 29 2021577
41303Jun 29 2021077
42304Jun 29 202127.57
43305Jun 29 2021077
44401Jun 29 2021277
45402Jun 29 2021177
46403Jun 29 2021077
47404Jun 29 202156.57
48405Jun 29 202107.57
49101Jun 29 202156.57
50102Jun 29 202156.57
51103Jun 29 2021077
52104Jun 29 2021077
53105Jun 29 202107.57
54201Jun 29 2021277
55202Jun 29 2021077
56203Jun 29 2021077
57204Jun 29 2021277
58205Jun 29 2021106.57
59301Jun 29 2021277
60302Jun 29 2021577
61303Jun 29 2021077
62304Jun 29 202127.57
63305Jun 29 2021077
64401Jun 29 2021277
65402Jun 29 2021177
66403Jun 29 2021077
67404Jun 29 202156.57
68405Jun 29 202107.57
69101July 28 2021155.55
70102July 28 202126.55
71103July 28 202126.56
72104July 28 202106.56
73105July 28 2021077
74201July 28 202106.55
75202July 28 202106.55
76203July 28 202156.55
77204July 28 2021575
78205July 28 20212065
79301July 28 2021555
80302July 28 20213055
81303July 28 202126.55
82304July 28 2021565
83305July 28 202126.55
84401July 28 2021265
85402July 28 202156.55
86403July 28 202156.55
87404July 28 20212065
88405July 28 2021565
89101August 12 202156.57
90102August 12 2021077
91103August 12 2021077
92104August 12 202126.57
93105August 12 202107.58
94201August 12 202107.58
95202August 12 2021078
96203August 12 2021378
97204August 12 202107.58
98205August 12 202156.58
99301August 12 2021467
100302August 12 2021668
101303August 12 202136.57
102304August 12 2021467
103305August 12 2021077
104401August 12 2021367
105402August 12 2021278
106403August 12 202107.58
107404August 12 2021867
108405August 12 2021277
109101August 24 20212567
110102August 24 20211067
111103August 24 202156.57
112104August 24 202156.57
113105August 24 202157.58
114201August 24 2021106.57
115202August 24 2021077
116203August 24 202156.57
117204August 24 2021577
118205August 24 2021107.57
119301August 24 20212067
120302August 24 20214057
121303August 24 20211567
122304August 24 2021155.57
123305August 24 2021577
124401August 24 2021255.57
125402August 24 2021106.57
126403August 24 2021106.57
127404August 24 20212567
128405August 24 20212067
ARMDataOrganizer



ARM Data Organization Macro.xlsm
KLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAU
7
8Plot #DateBP % TQTCPlot #DateBP % TQTCPlot #DateBP % TQTCPlot #DateBP % TQTCPlot #DateBP % TQTCPlot #DateBP % TQTCPlot #DateBP % TQTC
9101Jun 15 202107.57101Jun 29 202156.56.5101Jun 29 202156.56.5101Jun 29 202156.56.5101July 28 2021155.55101August 12 202156.57101August 24 20212566.5
10102Jun 15 202107.57102Jun 29 202156.56.5102Jun 29 202156.56.5102Jun 29 202156.56.5102July 28 202126.55102August 12 2021077102August 24 20211066.5
11103Jun 15 202107.57103Jun 29 2021076.5103Jun 29 2021076.5103Jun 29 2021076.5103July 28 202126.55.5103August 12 2021077103August 24 202156.57
12104Jun 15 202107.57104Jun 29 2021076.5104Jun 29 2021076.5104Jun 29 2021076.5104July 28 202106.56104August 12 202126.57104August 24 202156.57
13105Jun 15 202107.57105Jun 29 202107.56.5105Jun 29 202107.56.5105Jun 29 202107.56.5105July 28 2021077105August 12 202107.57.5105August 24 202157.57.5
14201Jun 15 2021077201Jun 29 2021276.5201Jun 29 2021276.5201Jun 29 2021276.5201July 28 202106.55201August 12 202107.57.5201August 24 2021106.56.5
15202Jun 15 202107.57202Jun 29 2021076.5202Jun 29 2021076.5202Jun 29 2021076.5202July 28 202106.55202August 12 2021077.5202August 24 2021077
16203Jun 15 2021077203Jun 29 2021076.5203Jun 29 2021076.5203Jun 29 2021076.5203July 28 202156.55203August 12 2021377.5203August 24 202156.56.5
17204Jun 15 2021077204Jun 29 2021276.5204Jun 29 2021276.5204Jun 29 2021276.5204July 28 2021575204August 12 202107.57.5204August 24 2021577
18205Jun 15 2021077205Jun 29 2021106.56.5205Jun 29 2021106.56.5205Jun 29 2021106.56.5205July 28 20212065205August 12 202156.57.5205August 24 2021107.57
19301Jun 15 202107.57301Jun 29 2021276.5301Jun 29 2021276.5301Jun 29 2021276.5301July 28 2021555301August 12 2021467301August 24 20212067
20302Jun 15 2021577302Jun 29 2021576.5302Jun 29 2021576.5302Jun 29 2021576.5302July 28 20213055302August 12 2021667.5302August 24 20214057
21303Jun 15 2021077303Jun 29 2021076.5303Jun 29 2021076.5303Jun 29 2021076.5303July 28 202126.55303August 12 202136.57303August 24 20211567
22304Jun 15 2021077304Jun 29 202127.56.5304Jun 29 202127.56.5304Jun 29 202127.56.5304July 28 2021565304August 12 2021466.5304August 24 2021155.57
23305Jun 15 202107.57305Jun 29 2021076.5305Jun 29 2021076.5305Jun 29 2021076.5305July 28 202126.55305August 12 2021077305August 24 2021577
24401Jun 15 202107.57401Jun 29 2021276.5401Jun 29 2021276.5401Jun 29 2021276.5401July 28 2021265401August 12 2021367401August 24 2021255.56.5
25402Jun 15 2021077402Jun 29 2021176.5402Jun 29 2021176.5402Jun 29 2021176.5402July 28 202156.55402August 12 2021277.5402August 24 2021106.57
26403Jun 15 2021077403Jun 29 2021076.5403Jun 29 2021076.5403Jun 29 2021076.5403July 28 202156.55403August 12 202107.57.5403August 24 2021106.57
27404Jun 15 2021077404Jun 29 202156.56.5404Jun 29 202156.56.5404Jun 29 202156.56.5404July 28 20212065404August 12 2021867404August 24 20212567
28405Jun 15 202107.57405Jun 29 202107.56.5405Jun 29 202107.56.5405Jun 29 202107.56.5405July 28 2021565405August 12 2021276.5405August 24 20212067
29
ARMDataOrganizer
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,223,912
Messages
6,175,340
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