Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 9th, 2006, 05:29 PM
Authorized User
 
Join Date: Dec 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automate 'Merge and Center' in VB

Hi there,

Does anyone know whether it is possible to automate Excels 'Merge and Center' cells function in Visual Basic?

I have a daily report imported in html format, and when this is cut and pasted into excel where cells are hidden, resulting is columns not matching up. Currently I ctrl+a and hit the Merge and center button in the Formatting Toolbar.

Any help or advice would mostly be appreciated, Thank you.


Derek


 
Old July 15th, 2006, 10:31 PM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Derek_05
 Hi there,

Does anyone know whether it is possible to automate Excels 'Merge and Center' cells function in Visual Basic?
Derek,

I'm not sure if this is what you're looking for - but you select a range in VB then simply:

Selection.merge

I had a similar issue and found that to work on my project.

Good luck!
-Michael






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Center Windows forms? chobo2 C# 1 September 11th, 2008 05:20 PM
How to automate selection of radio button using vb satish_k VB.NET 11 December 14th, 2006 11:28 AM
Do Any Use Application Center Test alyeng2000 ASP.NET 1.0 and 1.1 Professional 1 August 6th, 2004 04:25 AM
Automate Access 2000 in vb.net SupaHoopsa General .NET 0 June 22nd, 2004 05:35 AM
align Center melvik C# 1 September 7th, 2003 04:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.