PC Review


Reply
Thread Tools Rate Thread

Copying Range Just To Get Formatting?

 
 
(PeteCresswell)
Guest
Posts: n/a
 
      12th Jul 2007
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 With Quote
 
 
 
 
=?Utf-8?B?UG9wcyBKYWNrc29u?=
Guest
Posts: n/a
 
      12th Jul 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Conditional Formatting to range of cells =?Utf-8?B?Ym1hbjM0Mg==?= Microsoft Excel Worksheet Functions 8 14th Dec 2007 03:57 AM
Which is faster, copying range to another set of ranges or copying tomemory? axwack Microsoft Excel Programming 2 12th Dec 2007 01:19 PM
Copying Range Based On Certain Criteria? Possible looping through the Range Big H Microsoft Excel Programming 1 27th Oct 2006 03:32 AM
Formatting the 5 highest values in a range, and copying them to another sheet Bryan.Cook@gmail.com Microsoft Excel Programming 0 7th Apr 2006 01:29 PM
copying dynamic range based on cell outside of range xcelelder Microsoft Excel Programming 3 29th Sep 2005 05:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:30 AM.