Copy/concatenate based on condition

Status
Not open for further replies.

Flea2

New Member
Joined
Nov 3, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am just getting started with VBA and my need described below has similarities to other posts but adapting other solutions is beyond my current knowledge - I would greatly appreciate anyone who could advance my learning to achieve the following:

In the uploaded minisheet I show the "before and after" of what I need a VBA routine to do.

Specifically, in the Range A1:B9, I need the code to:
- check each row in turn, and where
the value in column A is = "", copy the value in the adjacent cell in Column B on the same row and
Add it (concatenate it) to the existing value (on a new line) in the cell immediately above it and then
Delete the complete row that had the value "" in Column A.

Thanks in advance for your help/coaching.

Concatonate Values on blank condition .xlsm
ABCDEFG
101-Nov-21Description 1of2< BEFOREAFTER >01-Nov-21Description 1of2 Description 2of2
2Description 2of202-Nov-21Description 1of2 Description 2of2
302-Nov-21Description 1of202-Nov-21Description 1
4Description 2of203-Nov-21Description 1
502-Nov-21Description 104-Nov-21Description 1of2 Description 2of2
603-Nov-21Description 105-Nov-21Description 1
704-Nov-21Description 1of2
8Description 2of2
905-Nov-21Description 1
Data-before&after
 
Status
Not open for further replies.

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