Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Merge cells using macro

NumRows = 1
NumCols = 2
With Range("A4").Resize(NumRows,NumCols)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.ShrinkToFit = False
.MergeCells = True
End With


Regards,
Tom Ogilvy

"Amy" wrote in message
...
I am trying to merge some cells using a macro. I'm
successful when using the command:

Range("A4:A5").select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.ShrinkToFit = False
.MergeCells = True
End With

However, the range of cells I want to merge is different
everytime, so I would like the macro to be able to count
the number of cells to be merged (some command that allows
definig a range using relative cell reference).

Thanks,

Amy



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge /Update Macro Ananth Excel Discussion (Misc queries) 7 July 21st 09 10:04 PM
Merge Macro jlclyde Excel Discussion (Misc queries) 4 January 11th 08 03:43 PM
Merge cells with formula or macro? Joe M. Excel Discussion (Misc queries) 5 July 23rd 07 10:28 PM
Excel Macro - Merge Cells unavailable - Unable to figue out why. newexceluser Excel Worksheet Functions 0 January 18th 06 03:22 PM
Mail Merge macro Wonder Women Excel Discussion (Misc queries) 4 January 5th 06 07:37 PM


All times are GMT +1. The time now is 11:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"