Move descriptions

Status
Not open for further replies.

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
890
Hi all, I would like to write a VBA code so that, to run through col. “F” and rows down and where exist bold descriptions should move them to adjacent cells in col. “A”​
Therefore, that the code should start from “F11”. Below I present the original data and the expected result. Thanking you in advance

ORIGINAL DATA


[TABLE="class: cms_table_MsoNormalTable"]
<tbody>[TR]
[TD][/TD]
[TD="width: 78"]
A
[/TD]
[TD="width: 45"]
B
[/TD]
[TD="width: 67"]
C
[/TD]
[TD="width: 150"]
D
[/TD]
[TD="width: 75"]
E
[/TD]
[TD="width: 143"]
F
[/TD]
[TD="width: 26"]
G
[/TD]
[TD="width: 131"]
H
[/TD]
[TD="width: 90"]
J
[/TD]
[/TR]
[TR]
[TD="width: 62"]
9
[/TD]
[TD="width: 78"]
Date
[/TD]
[TD="width: 45"]
TYPE
[/TD]
[TD="width: 67"]
CODE
[/TD]
[TD="width: 150"]
DEPARTMENT/REF.
[/TD]
[TD="width: 75"]
ENTRY #
[/TD]
[TD="width: 143"]
DEPARTMENT
[/TD]
[TD="width: 26"][/TD]
[TD="width: 131"]
DESCRIPTION
[/TD]
[TD="width: 90"]
AMOUNT
[/TD]
[/TR]
[TR]
[TD="width: 62"]
10
[/TD]
[TD="width: 78"][/TD]
[TD="width: 45"][/TD]
[TD="width: 67"][/TD]
[TD="width: 150"][/TD]
[TD="width: 75"][/TD]
[TD="width: 143"][/TD]
[TD="width: 26"][/TD]
[TD="width: 131"][/TD]
[TD="width: 90"][/TD]
[/TR]
[TR]
[TD="width: 62"]
11
[/TD]
[TD="width: 78"]
17-07-16
[/TD]
[TD="width: 45"]
RUR
[/TD]
[TD="width: 67"]
202060
[/TD]
[TD="width: 150"]
RESTAURANT 120125
[/TD]
[TD="width: 75"]
120125
[/TD]
[TD="width: 143"]
RESTAURANT
[/TD]
[TD="width: 26"][/TD]
[TD="width: 131"]
LEMONADE SQUASH
[/TD]
[TD="width: 90"]
120.25
[/TD]
[/TR]
[TR]
[TD="width: 62"]
12
[/TD]
[TD="width: 78"]
22-07-16
[/TD]
[TD="width: 45"]
ISS
[/TD]
[TD="width: 67"]
202075
[/TD]
[TD="width: 150"]
RESTAURANT 121255
[/TD]
[TD="width: 75"]
121255
[/TD]
[TD="width: 143"]
RESTAURANT
[/TD]
[TD="width: 26"][/TD]
[TD="width: 131"]
REFRESHMENTS
[/TD]
[TD="width: 90"]
250.48
[/TD]
[/TR]
[TR]
[TD="width: 62"]
13
[/TD]
[TD="width: 78"][/TD]
[TD="width: 45"][/TD]
[TD="width: 67"][/TD]
[TD="width: 150"][/TD]
[TD="width: 75"][/TD]
[TD="width: 143"]
RESTAURANT TOTAL
[/TD]
[TD="width: 26"][/TD]
[TD="width: 131"][/TD]
[TD="width: 90"]
370.73
[/TD]
[/TR]
[TR]
[TD="width: 62"]
14
[/TD]
[TD="width: 78"][/TD]
[TD="width: 45"][/TD]
[TD="width: 67"][/TD]
[TD="width: 150"][/TD]
[TD="width: 75"][/TD]
[TD="width: 143"][/TD]
[TD="width: 26"][/TD]
[TD="width: 131"][/TD]
[TD="width: 90"][/TD]
[/TR]
[TR]
[TD="width: 62"]
15
[/TD]
[TD="width: 78"]
12-06-18
[/TD]
[TD="width: 45"]
PUR
[/TD]
[TD="width: 67"]
202088
[/TD]
[TD="width: 150"]
POOL BAR 121230
[/TD]
[TD="width: 75"]
121230
[/TD]
[TD="width: 143"]
POOL BAR
[/TD]
[TD="width: 26"][/TD]
[TD="width: 131"]
ORANGE SQUASH
[/TD]
[TD="width: 90"]
108.95
[/TD]
[/TR]
[TR]
[TD="width: 62"]
16
[/TD]
[TD="width: 78"]
17-06-18
[/TD]
[TD="width: 45"]
ISS
[/TD]
[TD="width: 67"]
202095
[/TD]
[TD="width: 150"]
POOL BAR 121345
[/TD]
[TD="width: 75"]
121345
[/TD]
[TD="width: 143"]
POOL BAR
[/TD]
[TD="width: 26"][/TD]
[TD="width: 131"]
GRENADINE SYRUP
[/TD]
[TD="width: 90"]
95.45
[/TD]
[/TR]
[TR]
[TD="width: 62"]
17
[/TD]
[TD="width: 78"]
13-07-18
[/TD]
[TD="width: 45"]
PUR
[/TD]
[TD="width: 67"]
202009
[/TD]
[TD="width: 150"]
POOL BAR 122478
[/TD]
[TD="width: 75"]
122478
[/TD]
[TD="width: 143"]
POOL BAR
[/TD]
[TD="width: 26"][/TD]
[TD="width: 131"]
ICE TEA
[/TD]
[TD="width: 90"]
150.45
[/TD]
[/TR]
[TR]
[TD="width: 62"]
18
[/TD]
[TD="width: 78"][/TD]
[TD="width: 45"][/TD]
[TD="width: 67"][/TD]
[TD="width: 150"][/TD]
[TD="width: 75"][/TD]
[TD="width: 143"]
POOL BAR TOTAL
[/TD]
[TD="width: 26"][/TD]
[TD="width: 131"][/TD]
[TD="width: 90"]
354.85
[/TD]
[/TR]
</tbody>[/TABLE]



EXPECTED RESULT



[TABLE="class: cms_table_MsoNormalTable"]
<tbody>[TR]
[TD][/TD]
[TD="width: 101"]
A
[/TD]
[TD="width: 35"]
B
[/TD]
[TD="width: 67"]
C
[/TD]
[TD="width: 149"]
D
[/TD]
[TD="width: 75"]
E
[/TD]
[TD="width: 141"]
F
[/TD]
[TD="width: 26"]
G
[/TD]
[TD="width: 130"]
H
[/TD]
[TD="width: 89"]
J
[/TD]
[/TR]
[TR]
[TD="width: 61"]
9
[/TD]
[TD="width: 101"]
Date
[/TD]
[TD="width: 35"]
TYPE
[/TD]
[TD="width: 67"]
CODE
[/TD]
[TD="width: 149"]
DEPARTMENT/REF.
[/TD]
[TD="width: 75"]
ENTRY #
[/TD]
[TD="width: 141"]
DEPARTMENT
[/TD]
[TD="width: 26"][/TD]
[TD="width: 130"]
DESCRIPTION
[/TD]
[TD="width: 89"]
AMOUNT
[/TD]
[/TR]
[TR]
[TD="width: 61"]
10
[/TD]
[TD="width: 101"][/TD]
[TD="width: 35"][/TD]
[TD="width: 67"][/TD]
[TD="width: 149"][/TD]
[TD="width: 75"][/TD]
[TD="width: 141"][/TD]
[TD="width: 26"][/TD]
[TD="width: 130"][/TD]
[TD="width: 89"][/TD]
[/TR]
[TR]
[TD="width: 61"]
11
[/TD]
[TD="width: 101"]
17-07-16
[/TD]
[TD="width: 35"]
RUR
[/TD]
[TD="width: 67"]
202060
[/TD]
[TD="width: 149"]
RESTAURANT 120125
[/TD]
[TD="width: 75"]
120125
[/TD]
[TD="width: 141"]
RESTAURANT
[/TD]
[TD="width: 26"][/TD]
[TD="width: 130"]
LEMONADE SQUASH
[/TD]
[TD="width: 89"]
120.25
[/TD]
[/TR]
[TR]
[TD="width: 61"]
12
[/TD]
[TD="width: 101"]
22-07-16
[/TD]
[TD="width: 35"]
ISS
[/TD]
[TD="width: 67"]
202075
[/TD]
[TD="width: 149"]
RESTAURANT 121255
[/TD]
[TD="width: 75"]
121255
[/TD]
[TD="width: 141"]
RESTAURANT
[/TD]
[TD="width: 26"][/TD]
[TD="width: 130"]
REFRESHMENTS
[/TD]
[TD="width: 89"]
250.48
[/TD]
[/TR]
[TR]
[TD="width: 61"]
13
[/TD]
[TD="width: 101"]
RESTAURANT TOTAL
[/TD]
[TD="width: 35"][/TD]
[TD="width: 67"][/TD]
[TD="width: 149"][/TD]
[TD="width: 75"][/TD]
[TD="width: 141"][/TD]
[TD="width: 26"][/TD]
[TD="width: 130"][/TD]
[TD="width: 89"]
370.73
[/TD]
[/TR]
[TR]
[TD="width: 61"]
14
[/TD]
[TD="width: 101"][/TD]
[TD="width: 35"][/TD]
[TD="width: 67"][/TD]
[TD="width: 149"][/TD]
[TD="width: 75"][/TD]
[TD="width: 141"][/TD]
[TD="width: 26"][/TD]
[TD="width: 130"][/TD]
[TD="width: 89"][/TD]
[/TR]
[TR]
[TD="width: 61"]
15
[/TD]
[TD="width: 101"]
12-06-18
[/TD]
[TD="width: 35"]
PUR
[/TD]
[TD="width: 67"]
202088
[/TD]
[TD="width: 149"]
POOL BAR 121230
[/TD]
[TD="width: 75"]
121230
[/TD]
[TD="width: 141"]
POOL BAR
[/TD]
[TD="width: 26"][/TD]
[TD="width: 130"]
ORANGE SQUASH
[/TD]
[TD="width: 89"]
108.95
[/TD]
[/TR]
[TR]
[TD="width: 61"]
16
[/TD]
[TD="width: 101"]
17-06-18
[/TD]
[TD="width: 35"]
ISS
[/TD]
[TD="width: 67"]
202095
[/TD]
[TD="width: 149"]
POOL BAR 121345
[/TD]
[TD="width: 75"]
121345
[/TD]
[TD="width: 141"]
POOL BAR
[/TD]
[TD="width: 26"][/TD]
[TD="width: 130"]
GRENADINE SYRUP
[/TD]
[TD="width: 89"]
95.45
[/TD]
[/TR]
[TR]
[TD="width: 61"]
17
[/TD]
[TD="width: 101"]
13-07-18
[/TD]
[TD="width: 35"]
PUR
[/TD]
[TD="width: 67"]
202009
[/TD]
[TD="width: 149"]
POOL BAR 122478
[/TD]
[TD="width: 75"]
122478
[/TD]
[TD="width: 141"]
POOL BAR
[/TD]
[TD="width: 26"][/TD]
[TD="width: 130"]
ICE TEA
[/TD]
[TD="width: 89"]
150.45
[/TD]
[/TR]
[TR]
[TD="width: 61"]
18
[/TD]
[TD="width: 101"]
POOL BAR TOTAL
[/TD]
[TD="width: 35"][/TD]
[TD="width: 67"][/TD]
[TD="width: 149"][/TD]
[TD="width: 75"][/TD]
[TD="width: 141"][/TD]
[TD="width: 26"][/TD]
[TD="width: 130"][/TD]
[TD="width: 89"]
354.85
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Status
Not open for further replies.

Similar threads

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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