VBA to Concatenate Variable Range

Leopard011

New Member
Joined
Oct 24, 2012
Messages
3
Dear All,
I have a problem with a worksheet that my company accounting system exports every month.

Below is the download link of sample of the worksheet because I wasn't able to attach it to this thread.
vba.xlsx

In column ( F ) , I need a macro to do the following calculations:
1- Check for the Title – if it begins with "Cost Center"
2- Check for the Title – if it begins with "Account Code"
3- Detect the Range Start just below "Account Code" , and End with the row above "Total"
4- Concatenate the string written in each row of the range with the string in "Cost Center"

The Story is:
Each Month I've this worksheet with hundreds of Cost Centers and subsidiary Account Codes, And to be able to analyze the accounts efficiently I need to concatenate both Cost Centers & Account Codes manually ( as you see coloring sample in the sample file ).
Which led to wasting many hours , and high risk of error while copying and pasting formulas.

Your help on this matter will be highly appreciated.
Best Regards.
 
One more improvement for the case data in the source column starts from not the 1st row,
Was: Columns(Dest.Column).Value = b()
Should be: Rng.EntireRow.Columns(Dest.Column).Value = b()
 
Last edited:
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
*** deleted duplicate of above post ****
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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