Solved

Retaining destination cell formats when copying by formula.

Posted on 2011-02-17
5
243 Views
Last Modified: 2012-05-11
Hello!
Im working with Excel 2003.
I have a formula in a cell which copies an entry from a static set of values, selecting the value with the OFFSET function.
in consecutive cells A1, B1, C1 etc. in a row I will have
=OFFSET('Static Set'!A1,0,7-AFixedValuel,,1), then
=OFFSET('Static Set'!B1,0,7-AFixedValuel,,1), then
=OFFSET('Static Set'!C1,0,7-AFixedValuel,,1) etc.
In this way, as "AFixedValue"  changes, the "string" of consecutive static values appears in the destination cells.
My problem is that the destination cells have a coloured background, which is destroyed by the formula, 'cos the formula "copies" the formatting of the "Source" cell.
I can't use "Paste Special", as this is a Formula.
I was hoping there was a function like CELLVALUEONLY (or some such), so I couk rewrite the destination cell's formula as
=CELLVALUEONLY(OFFSET('Static Set'!B1,0,7-AFixedValuel,,1))
Unfortunately, I can't find anything like CELLVALUEONLY as a function.
Have any of you good people found a workaround, or am I barking up a blue herring?

Steve
0
Comment
Question by:sts023
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 250 total points
ID: 34917987
Using an OFFSET (or any other) formula should not affect the formatting of the cell it is in (unless you are applying that formatting by Conditional Formatting).
0
 

Author Comment

by:sts023
ID: 34919556
Hi Rorya,

That's what I thought, but it does!

I'm actually trying to develop this process at a centre I volunteer at, and I've noticed other minor discrepancies before.

I'm running under Vista, they're running under XP. We both have Excel 2003.

Does anyone know of any "global" settings which may be having this effect?
I've tried looking for some setting such as "always use source formatting in formulae", but as I couldn't find anything, I thought I'd post the query.

It's a bit of a head-scratcher, and my experience says there will be a simple solution/reason, it's just that at the moment it escapes me!

Steve
0
 
LVL 45

Assisted Solution

by:patrickab
patrickab earned 250 total points
ID: 34933069
Steve,

There a button you can add to your standard command bar that will Paste Values only. At the right hand end of the Command Bar click the down arrow and select 'Add or remove button', select Customize/Commands/Edit and find the 'Paste Values' button which is a clipboard with a 12 on it - add that button.

Having done that all you need to do is copy the source cell, and use the new button to paste the value into the destination cell.

Patrick
0
 

Author Comment

by:sts023
ID: 34933181
Hi guys....

The original problem was caused by an idiot - me!

I hadn't realised I was executing a standard Copy & Paste function. Now I've woken up, and purely for you guys having the kindness to reply to an idiot, I'm sharing the points between you.

Thanks for everything - my life's changing again (redundancy), so good luck to you all in the future....

Steve
0
 
LVL 45

Expert Comment

by:patrickab
ID: 34933254
Steve,

Thanks for the points.

Don't be too downhearted about redundancy. It's just the way of the world. Pick yourself up again and keep going.

Patrick
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question