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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
.
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,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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