LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default How do I select a range to merge cells?

I want to take a group of cells and merge them. I know they will always be
columns B through F, but the row number will vary. I saved the row number
in a variable (rownum), but can't figure out how to then select those cells
to merge. I have this, but it doesn't work. I would appreciate any help you
can give me. Thanks in advance,


Dim SelRange As Range
Set SelRange = ActiveSheet.ActiveCell.Range(Cells(rownum, 2),
Cells(rownnum, 6))

Range(SelRange).Select
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With

 
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
Select Merged Cells and Unmerge Spread Merge Data To All Cells rtwiss via OfficeKB.com Excel Programming 2 October 2nd 08 04:24 AM
Mail merge macro: select recipients from Excel during merge Worksmart Excel Programming 0 May 18th 08 06:37 PM
How do I use For loop to pick different Range of cells to Select & Merge? [email protected] Excel Programming 3 February 3rd 07 02:02 AM
Need to select 4 cells and merge them using Excell 2003 jfcby[_2_] Excel Programming 2 August 29th 06 06:00 PM
Select and merge cells with duplicate values leonidas[_78_] Excel Programming 0 August 22nd 06 05:03 PM


All times are GMT +1. The time now is 01:03 PM.

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

About Us

"It's about Microsoft Excel"