Macros for Merge and Centre

H

Hardeep kanwar

Dear Expert

I have data like Below Mentioned in column A and Column B.I Want to Merge
and Center the Data in Column based on column A.

DEALER NAME
A M MOTORS MALLAPURAM 8
A M MOTORS MALLAPURAM
AALIANZ AUTOMOBILES NEW DELHI 7.35
AALIANZ AUTOMOBILES NEW DELHI
AALIANZ AUTOMOBILES NEW DELHI
AALIANZ AUTOMOBILES NEW DELHI
AALIANZ AUTOMOBILES NEW DELHI
ABHARAN MOTORS UDUPI 7.88
ABT MARUTI CHENNAI 7.89
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
AGENCY HOUSE PORT BLAIR 8.27
AGENCY HOUSE PORT BLAIR
AGR AUTOMOBILES PVT LTD VARANASI 8.77
AJMER AUTOMOBILES PVT LTD AJMER 8.44
AMAR CARS PVT LTD VADODARA 8.11
AMAR CARS PVT LTD VADODARA
AMAR CARS PVT LTD VADODARA
AMAR CARS PVT LTD VADODARA
AMAR CARS PVT LTD VADODARA
AMAR CARS PVT LTD VADODARA
AMAR CARS PVT LTD VADODARA

I need a Macro.I have 6000 data in one sheet.I have 18 Sheets like this

Thanks in Advance

Hardeep kanwar
 
C

CurlyDave

Dear Expert

I have data like Below Mentioned in column A and Column B.I Want to Merge
and Center the Data in Column based on column A.

DEALER NAME    
A M MOTORS MALLAPURAM   8
A M MOTORS MALLAPURAM  
AALIANZ AUTOMOBILES NEW DELHI   7.35
AALIANZ AUTOMOBILES NEW DELHI  
AALIANZ AUTOMOBILES NEW DELHI  
AALIANZ AUTOMOBILES NEW DELHI  
AALIANZ AUTOMOBILES NEW DELHI  
ABHARAN MOTORS UDUPI    7.88
ABT MARUTI CHENNAI      7.89
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
ABT MARUTI CHENNAI      
AGENCY HOUSE PORT BLAIR 8.27
AGENCY HOUSE PORT BLAIR
AGR AUTOMOBILES PVT LTD VARANASI        8.77
AJMER AUTOMOBILES PVT LTD AJMER 8.44
AMAR CARS PVT LTD VADODARA      8.11
AMAR CARS PVT LTD VADODARA      
AMAR CARS PVT LTD VADODARA      
AMAR CARS PVT LTD VADODARA      
AMAR CARS PVT LTD VADODARA      
AMAR CARS PVT LTD VADODARA      
AMAR CARS PVT LTD VADODARA

I need a Macro.I have 6000 data in one sheet.I have 18 Sheets like this

Thanks in Advance

Hardeep kanwar

Why would you want to do that?


Sub Button3_Click()
Dim r As Range
Dim c As Range

Set r = Range("A1", Range("A65536").End(xlUp))

Application.DisplayAlerts = False

For Each c In r.Cells

c = c & " " & c.Offset(0, 1)
c.Range("A1:B1").Merge
With c
.HorizontalAlignment = xlCenter
End With
Next c
Application.DisplayAlerts = True

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Merge and Centre 3

Top