Required merging with macro button!

Kamran01

Board Regular
Joined
Feb 10, 2017
Messages
86
Hi Genius,

I need Little help regarding Merging cells with a button..
I am creating a Gantt Chart using excel formulas..

I want when i press a button, it Show me merge data according to below range.

1) B2:G2
2) B3:D3 & E3:I3
3) B4:F4


[TABLE="class: grid, width: 100, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]LINES #[/TD]
[TD]2/10[/TD]
[TD]3/10[/TD]
[TD]4/10[/TD]
[TD]5/10[/TD]
[TD]6/10[/TD]
[TD]7/10[/TD]
[TD]8/10[/TD]
[TD]9/10[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]HS-01[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]C&A | CHINO DOBBY 1| 5900 | 23 | 23/JAN | 0[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]HS-02[/TD]
[TD][/TD]
[TD][/TD]
[TD]C&A | BASIC| 8000 | 23 | 23/JAN | -2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]C&A | JACKET | 10000 | 23 | 23/JAN | -11[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]HS-03[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]C&A | ROMPER | 9800 | 23 | 23/JAN | 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
.
Is this what you are seeking ?

Code:
Sub delete_empty_cells_shift_left()
    Range("A1:I5").Select
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.Delete Shift:=xlToLeft
End Sub
 
Upvote 0
Hi Logit,

I mean i have not to delete blank cells but have to merge cells from next to filled column till filled column.
This is not working for me like my problem is..

Thanks,
Kamran Noor
 
Upvote 0
.
Post and AFTER image so we know what you are seeking.

How do you want the cells to be / look after the merge ?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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