Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Resizing a merged range

I currently have a block of cells that I've merged to create a big "Comments"
section on a worksheet. I now need to expand that block (by, let's say 10
rows) and then reestablish the print area (of the entire worksheet) to fit on
1 page. I'll get to the printing part later but currently, I need a tip on
how to select multiple cells (like the click-and-drag mouse method)
programmatically.

I have the following code/pseudo-code:

'Find the Comments section
Cells.Find(What:="Comments").Select 'find the header
ActiveCell.Offset(1, 0).Select 'go down to the next
row/cell
Selection.Clear 'unmerge cells
'*********here's where I get lost************
ActiveCell.Offset(10, 0).Select 'select next 10
rows/cells
Remerge the cells (hopefully the # of columns remains the same)

So, I need to keep selecting cells (in a loop?) and then merge them.

Any pointers are greatly appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Resizing a merged range

'*********here's where I get lost************

Me too. You want to select 10 cells down a column starting with the active
cell?

ActiveCell.Resize(10).Select

Remerge the cells


What does "remerge" mean?

--
Jim
"ReportSmith" wrote in message
...
I currently have a block of cells that I've merged to create a big
"Comments"
section on a worksheet. I now need to expand that block (by, let's say 10
rows) and then reestablish the print area (of the entire worksheet) to fit
on
1 page. I'll get to the printing part later but currently, I need a tip
on
how to select multiple cells (like the click-and-drag mouse method)
programmatically.

I have the following code/pseudo-code:

'Find the Comments section
Cells.Find(What:="Comments").Select 'find the header
ActiveCell.Offset(1, 0).Select 'go down to the
next
row/cell
Selection.Clear 'unmerge
cells
'*********here's where I get lost************
ActiveCell.Offset(10, 0).Select 'select next 10
rows/cells
Remerge the cells (hopefully the # of columns remains the same)

So, I need to keep selecting cells (in a loop?) and then merge them.

Any pointers are greatly appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Resizing a merged range

I'm not exactly sure what you want, so this is purely a guess

Sub Test()

'Find the Comments section
Cells.Find(What:="Comments").Select 'find the header
ActiveCell.Offset(1, 0).Select 'go down to the
nextrow/cell
Selection.MergeCells = False
'unmerge cells
'*********here's where I get lost************
ActiveCell.Resize(10, 1).MergeCells = True 'select
next 10rows/cells


End Sub


"ReportSmith" wrote:

I currently have a block of cells that I've merged to create a big "Comments"
section on a worksheet. I now need to expand that block (by, let's say 10
rows) and then reestablish the print area (of the entire worksheet) to fit on
1 page. I'll get to the printing part later but currently, I need a tip on
how to select multiple cells (like the click-and-drag mouse method)
programmatically.

I have the following code/pseudo-code:

'Find the Comments section
Cells.Find(What:="Comments").Select 'find the header
ActiveCell.Offset(1, 0).Select 'go down to the next
row/cell
Selection.Clear 'unmerge cells
'*********here's where I get lost************
ActiveCell.Offset(10, 0).Select 'select next 10
rows/cells
Remerge the cells (hopefully the # of columns remains the same)

So, I need to keep selecting cells (in a loop?) and then merge them.

Any pointers are greatly appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Resizing a merged range

Yes.

"Jim Rech" wrote:

'*********here's where I get lost************


Me too. You want to select 10 cells down a column starting with the active
cell?

ActiveCell.Resize(10).Select

Remerge the cells


What does "remerge" mean?

--
Jim
"ReportSmith" wrote in message
...
I currently have a block of cells that I've merged to create a big
"Comments"
section on a worksheet. I now need to expand that block (by, let's say 10
rows) and then reestablish the print area (of the entire worksheet) to fit
on
1 page. I'll get to the printing part later but currently, I need a tip
on
how to select multiple cells (like the click-and-drag mouse method)
programmatically.

I have the following code/pseudo-code:

'Find the Comments section
Cells.Find(What:="Comments").Select 'find the header
ActiveCell.Offset(1, 0).Select 'go down to the
next
row/cell
Selection.Clear 'unmerge
cells
'*********here's where I get lost************
ActiveCell.Offset(10, 0).Select 'select next 10
rows/cells
Remerge the cells (hopefully the # of columns remains the same)

So, I need to keep selecting cells (in a loop?) and then merge them.

Any pointers are greatly appreciated.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Resizing a merged range

Remerge = just merge the cells again (after selecting the extra cells)

"Jim Rech" wrote:

'*********here's where I get lost************


Me too. You want to select 10 cells down a column starting with the active
cell?

ActiveCell.Resize(10).Select

Remerge the cells


What does "remerge" mean?

--
Jim
"ReportSmith" wrote in message
...
I currently have a block of cells that I've merged to create a big
"Comments"
section on a worksheet. I now need to expand that block (by, let's say 10
rows) and then reestablish the print area (of the entire worksheet) to fit
on
1 page. I'll get to the printing part later but currently, I need a tip
on
how to select multiple cells (like the click-and-drag mouse method)
programmatically.

I have the following code/pseudo-code:

'Find the Comments section
Cells.Find(What:="Comments").Select 'find the header
ActiveCell.Offset(1, 0).Select 'go down to the
next
row/cell
Selection.Clear 'unmerge
cells
'*********here's where I get lost************
ActiveCell.Offset(10, 0).Select 'select next 10
rows/cells
Remerge the cells (hopefully the # of columns remains the same)

So, I need to keep selecting cells (in a loop?) and then merge them.

Any pointers are greatly appreciated.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Resizing a merged range

Barb,
Good guess...Thank you. With some additional tweaking, I got the code to do
what I wanted. Now it's on to the next step.

Thanks again.

"Barb Reinhardt" wrote:

I'm not exactly sure what you want, so this is purely a guess

Sub Test()

'Find the Comments section
Cells.Find(What:="Comments").Select 'find the header
ActiveCell.Offset(1, 0).Select 'go down to the
nextrow/cell
Selection.MergeCells = False
'unmerge cells
'*********here's where I get lost************
ActiveCell.Resize(10, 1).MergeCells = True 'select
next 10rows/cells


End Sub


"ReportSmith" wrote:

I currently have a block of cells that I've merged to create a big "Comments"
section on a worksheet. I now need to expand that block (by, let's say 10
rows) and then reestablish the print area (of the entire worksheet) to fit on
1 page. I'll get to the printing part later but currently, I need a tip on
how to select multiple cells (like the click-and-drag mouse method)
programmatically.

I have the following code/pseudo-code:

'Find the Comments section
Cells.Find(What:="Comments").Select 'find the header
ActiveCell.Offset(1, 0).Select 'go down to the next
row/cell
Selection.Clear 'unmerge cells
'*********here's where I get lost************
ActiveCell.Offset(10, 0).Select 'select next 10
rows/cells
Remerge the cells (hopefully the # of columns remains the same)

So, I need to keep selecting cells (in a loop?) and then merge them.

Any pointers are greatly appreciated.

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
Resizing merged / wrapped cells. Nathan Elphick Excel Discussion (Misc queries) 2 October 25th 07 10:53 AM
How do i insert a picture in merged cels, with autom. resizing ? Sven Ghyselinck Excel Programming 5 March 27th 06 09:25 PM
resizing a range don Excel Programming 3 February 19th 06 12:23 PM
Resizing my range - End row Jacqui Excel Programming 3 November 1st 05 06:00 PM
resizing a range Tim Kredlo Excel Programming 1 September 27th 05 08:30 PM


All times are GMT +1. The time now is 09:29 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"