Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Copying Conditional Formatting Fails

Hi,

When I attempt to copy the conditional formatting of the following, it
does not copy correctly.

a b c
1 First MI Last
2 Jack M Harris
3 Sally J Smith
4 Bill V Nelson

Cells A2 - C2 have conditional formatting applied to them. I have
attempted to Copy - Paste Special -- Formats, but this code fails:

Range("A1:C1").Select
Selection.Copy
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A2:C4").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

I will be calculating the row count via code (I don't have that handy)
so the absolute reference to C4 will be replaced with C & rowcount.

Any help you can lend would be appreciated.

Henry

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Copying Conditional Formatting Fails

Hi Henry,

I could be wrong but your code is copying A1:C1 and not A2:C2, which
has the conditional formatting applied to them. Try amending the first
line of code to copy from row 2!

Good luck,

Les Bantleman


Henry Stockbridge wrote:
Hi,

When I attempt to copy the conditional formatting of the following, it
does not copy correctly.

a b c
1 First MI Last
2 Jack M Harris
3 Sally J Smith
4 Bill V Nelson

Cells A2 - C2 have conditional formatting applied to them. I have
attempted to Copy - Paste Special -- Formats, but this code fails:

Range("A1:C1").Select
Selection.Copy
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A2:C4").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

I will be calculating the row count via code (I don't have that handy)
so the absolute reference to C4 will be replaced with C & rowcount.

Any help you can lend would be appreciated.

Henry


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying Conditional Formatting Fails


Thats because when you use conditional formatting your expression looks
something like this =$A$1=""fred", notice the $ it makes things an absolute reference if your expression
looked like this =$A1=""fred" it will copy down fine!

Regards,
Simon


--
Simon Lloyd
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Copying Conditional Formatting Fails


Simon Lloyd wrote:
Thats because when you use conditional formatting your expression looks
something like this =$A$1=""fred", notice the $ it makes things an absolute reference if your expression
looked like this =$A1=""fred" it will copy down fine!

Regards,
Simon


--
Simon Lloyd


------------------------------------------------------

Thanks for the help.

Henry

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loopk up in Excel


Simon Lloyd;7036717 Wrote:
This may give you something to work with!

Code:
--------------------
=IF(COUNTIF(Sheet1!$A:$A,VLOOKUP("Fred",Sheet1!$A: $A,1,FALSE)),Sheet1!A1,"")

--------------------
This formula can be copied across and then down

and will show the users data, its not perfect by any means as i am a
beginner at this but it may prompt someone to perfect it for you!
Try copying it in to sheet 2 A1 and copy across and down it will fill
in any instance of Fred and related data but only in the rows he
appears!

Regards,
SImonForgot to mention that you could then filter the sheet for Non-Blanks to

see all of your data!

Regards,
Simon


--
Simon Lloyd


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loopk up in Excel


A friend of mine at another forum, Bob Phillips had a look at your
rpoblem and then sent me this link
which has a worked example on it and will achieve what you need!

http://cjoint.com/?mocvNF4mEp

Regards,
Simon


--
Simon Lloyd
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 Bagheera Excel Discussion (Misc queries) 1 February 25th 10 08:03 PM
Copying Conditional formatting gibbylynn Excel Discussion (Misc queries) 2 January 25th 10 05:09 PM
Conditional Formatting: Logical AND fails to work with INDIRECT(.. Hamish Excel Worksheet Functions 5 May 15th 08 04:54 PM
copying conditional formatting zzdave Excel Discussion (Misc queries) 5 March 15th 08 11:41 PM
Copying Conditional Formatting SMac Excel Discussion (Misc queries) 3 March 11th 05 07:28 PM


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