Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Combining 2 Ranges in a Single WITH Statement

I am formatting a totals column and a totals row with exactly the same set
of formats.

Currently I use these two 'with' statements:

With .Range(.Cells(mRow + 1, 1), .Cells(mRow + 1, 6))

With .Range(.Cells(6, 6), .Cells(mRow, 6))

Since the formatting statements in each 'with' block are identical, I think
there must be a way to combine those into a single 'with' block.

Can anyone let me know if that can be done, and, if so, what that the 'with'
statement would look like?

thanks,
Ken Loomis


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Combining 2 Ranges in a Single WITH Statement

with union(range1, range2)
....
end with

Tim


"Ken Loomis" wrote in message
...
I am formatting a totals column and a totals row with exactly the
same set of formats.

Currently I use these two 'with' statements:

With .Range(.Cells(mRow + 1, 1), .Cells(mRow + 1, 6))

With .Range(.Cells(6, 6), .Cells(mRow, 6))

Since the formatting statements in each 'with' block are identical,
I think there must be a way to combine those into a single 'with'
block.

Can anyone let me know if that can be done, and, if so, what that
the 'with' statement would look like?

thanks,
Ken Loomis




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Combining 2 Ranges in a Single WITH Statement

Thanks, Tim.

"Tim Williams" <saxifrax@pacbell*dot*net wrote in message
...
with union(range1, range2)
...
end with

Tim


"Ken Loomis" wrote in message
...
I am formatting a totals column and a totals row with exactly the same set
of formats.

Currently I use these two 'with' statements:

With .Range(.Cells(mRow + 1, 1), .Cells(mRow + 1, 6))

With .Range(.Cells(6, 6), .Cells(mRow, 6))

Since the formatting statements in each 'with' block are identical, I
think there must be a way to combine those into a single 'with' block.

Can anyone let me know if that can be done, and, if so, what that the
'with' statement would look like?

thanks,
Ken Loomis






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
Combining different charts on a single chart matsolbach Charts and Charting in Excel 4 April 21st 23 05:20 PM
Combining several cells into single equasion? Nagel Oxles Excel Worksheet Functions 1 August 4th 09 07:34 AM
Combining Ranges Luke Bailey Excel Worksheet Functions 1 May 15th 06 10:45 PM
Combining like worksheets into a single worksheet JAS Excel Worksheet Functions 2 February 14th 06 03:24 PM
Combining Two Ranges SoCalExcel Excel Programming 4 December 4th 03 07:10 PM


All times are GMT +1. The time now is 02:57 PM.

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"