Merging Columns based on two criteria

puppy26

New Member
Joined
Feb 23, 2012
Messages
42
Dear all,.
I'm fairly new to VBA programming.

I would like to merge 7 columns if two conditions are meet.

Start Week Ending week Jan Feb Mar Apr May Jun July Aug Sept Oct Nov Dec
7 11
7 11 12
1 53 1
1 53 1




If the values in the column A is 1 and column B is 53, I want to merge the columns C3 to N3

If the values in the column A is 7 and column B is 11, I want to merge the columns D2 to E2

Is it feasible using VBA programming or Do I have any functions??

Please do help me.

Many thanks!

Regards,
Puppy​
 
Sorry, I didn't get it still.
For example I am speaking for the second row.

The starting week number is 13. But 13th week is on March for this year.

Why did you show the percentage on April?!
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
well, If im not wrong, the week number 13th is April this year..

anyway lets keep it simple.. First 4 weeks matches Jan, 5-8 matches Feb, 9-12 March, 13-16 April.. every 4 weeks matches one month....
 
Upvote 0
I want to merge the columns based on the start week and end week. Every 4 weeks represent one month...

If the value of start week is 1 and end week is 44, I want the <ACRONYM title="visual basic for applications">vba</ACRONYM> code to merge the cell from Jan to October as one cell.

If the value of start week is 9 and end week is 53, I want the <ACRONYM title="visual basic for applications">vba</ACRONYM> code to merge the cell from March to December as one cell..

If the value of start week is 30 and end week is 46, I want the <ACRONYM title="visual basic for applications">vba</ACRONYM> code to merge the cell from August to November as one cell..

Hope Im clear this time..
 
Upvote 0
ah ok. Sorry.. ok then I think you understood the concept already...

Now it's simple.. Based on the corresponding start and end week, I want the vba code to merge the column as one cell..

Is that ok for you??
 
Upvote 0
ah ok. Sorry.. ok then I think you understood the concept already...

Now it's simple.. Based on the corresponding start and end week, I want the vba code to merge the column as one cell..

Is that ok for you??

Hi Flashbond,
Can I expect some answer from you today!! Please.
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,110
Members
449,205
Latest member
ralemanygarcia

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