Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Copying Range Just To Get Formatting?

I've got a "WhatIf" section on a spreadsheet where the user can
choose a couple of entities via .Validation drop down boxes.

When one entity is chosen but the other is not, I need to clear
the contents of many cells in that row.

..Range.Clear doesn't work because it clears the borders of the
cells too.

Or am I missing something in .Clear?

If not, it seems like one approach would be to create a model
range in an invisible row - that has the borders desired - and
copy said model over the WhatIf columns when it's time to clear
them.

But I've got a chicken-egg problem with the model: only place I
can get it is a place on the sheet where cells are already
populated with values.... but .sourceRange.Copy targetRange
doesn't seem to have a provision for copying only formatting and
leaving the data behind.

I'm striking out on .PasteSpecial - although it *seems* like it
should do the job with the right parms specified.

Can anybody offer a suggestion? Am I barking up the wrong tree
here?


I do not want to explicitly format the model range because when
the sheet is created via VBA, the user can specify options that
affect the layout of the rows - hence the "model" approach.
--
PeteCresswell
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Copying Range Just To Get Formatting?

Use .ClearContents
--
Pops Jackson


"(PeteCresswell)" wrote:

I've got a "WhatIf" section on a spreadsheet where the user can
choose a couple of entities via .Validation drop down boxes.

When one entity is chosen but the other is not, I need to clear
the contents of many cells in that row.

..Range.Clear doesn't work because it clears the borders of the
cells too.

Or am I missing something in .Clear?

If not, it seems like one approach would be to create a model
range in an invisible row - that has the borders desired - and
copy said model over the WhatIf columns when it's time to clear
them.

But I've got a chicken-egg problem with the model: only place I
can get it is a place on the sheet where cells are already
populated with values.... but .sourceRange.Copy targetRange
doesn't seem to have a provision for copying only formatting and
leaving the data behind.

I'm striking out on .PasteSpecial - although it *seems* like it
should do the job with the right parms specified.

Can anybody offer a suggestion? Am I barking up the wrong tree
here?


I do not want to explicitly format the model range because when
the sheet is created via VBA, the user can specify options that
affect the layout of the rows - hence the "model" approach.
--
PeteCresswell

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
Copying Conditional Formatting to range of cells bman342 Excel Worksheet Functions 8 December 14th 07 03:57 AM
Copying Range Based On Certain Criteria? Possible looping through the Range Big H Excel Programming 1 October 27th 06 03:32 AM
Formatting the 5 highest values in a range, and copying them to another sheet [email protected] Excel Programming 0 April 7th 06 01:29 PM
copying dynamic range based on cell outside of range xcelelder Excel Programming 3 September 29th 05 05:08 PM
Searching a range and copying values into a new range.... **Please help** :( Lancia Excel Programming 1 September 29th 04 01:08 PM


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