“Background Color” Issue. Range Copy Works. Rows Copy Don’t. What I see is not what I Get / Have?
Hi,
. I am a Beginner myself, but learning by answering Threads here.
. I Hit a problem while answering a Thread, which I got over but I do not understand what is going on and suspect the answer may be obvious to a Profi.
. Can someone help:
.
. I try to summarize the problem with a shortened example.
.
. I have prepared a sample sheet to demonstrate the problem
. I start with this:
Using Excel 2007
Row\Col |
B |
C |
D |
E |
F |
G |
H |
I |
J |
4 |
|
|
|
|
|
|
|
|
|
5 |
|
|
|
|
|
|
|
|
|
6 |
|
|
|
|
|
|
|
|
|
7 |
|
|
|
|
|
|
|
|
|
… I run the following code, and get what I expect from Part 1) when I copy a Range. The method I use here is to copy the actual range of interest
.. What I do not understand is that when I try to do the same in Part 2) I do not get the format copied, that is to say the “Background color” is not copied. The method I use here is to copy the entire rows containing the range of interest.
.. There appears to be some formatting issues which behave differently in the two methods.
… Here is the Test Code I am using:
… applying this code to the first screen shot above I obtain the following results:
Using Excel 2007
Row\Col |
B |
C |
D |
E |
F |
G |
H |
I |
J |
4 |
|
|
|
|
|
|
|
|
|
5 |
|
|
|
|
|
|
|
|
|
6 |
|
|
|
|
|
|
|
|
|
7 |
|
|
|
|
|
|
|
|
|
8 |
|
|
|
|
|
|
|
|
|
9 |
|
|
|
|
|
|
|
|
|
10 |
|
|
|
|
|
|
|
|
|
11 |
|
|
|
|
|
|
|
|
|
12 |
|
|
|
|
|
|
|
|
|
13 |
|
|
|
|
|
|
|
|
|
… as you can see the second method ( Part 2) ) has failed to copy the format. It does work If I add actual background color. So clearly what I am seeing as “background color” in the first screen shot is not the background color that I have encountered up until now........
- Clearly there is something in the File I do not understand -
- so It will be necessary for anyone trying to help me to see the File. -
- I therefore upload the File ( The test macro is in the sheet "CopyFormatProblem" Module )
. - The sheet of interest is sheet "CopyFormatProblem"
.
. Questions:
. Could anyone Please
. 1 ) Enlighten me on what is going on here to give the discrepancy in the two methods
. 2 )Explain / show with a code, how I could get Part 2) ( Copying the rows Method ) to also copy the “Background color”
.
. Thanks ( From me and the OP waiting for my solution )
Alan Elston
Bookmarks