Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a range name with few cell containing conditional formation, when I copy that range to an other workbook using code like this, the conditional formatting is not copied. Range("MYRANGE").Select Selection.SpecialCells(xlCellTypeVisible).Copy Application.Windows(temp2).Activate Workbooks(temp2).Worksheets("MYSHEET").Range("A1") .Paste Range("MYRANGE").Select Selection.SpecialCells(xlCellTypeVisible).Copy Application.Windows(temp2).Activate Workbooks(temp2).Worksheets(MYSHEET).Range("A1").P asteSpecial Paste:=xlPasteValues I apreciate any help. Thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ben,
You need to actually paste the formatting: Range("MYRANGE").SpecialCells(xlCellTypeVisible).C opy 'Paste Values Workbooks(temp2).Worksheets(MYSHEET).Range("A1").P asteSpecial _ Paste:=xlPasteValues 'Paste FORMATS Workbooks(temp2).Worksheets(MYSHEET).Range("A1").P asteSpecial _ Paste:=xlPasteFormats HTH, Bernie MS Excel MVP "Ben" wrote in message ... Hi, I have a range name with few cell containing conditional formation, when I copy that range to an other workbook using code like this, the conditional formatting is not copied. Range("MYRANGE").Select Selection.SpecialCells(xlCellTypeVisible).Copy Application.Windows(temp2).Activate Workbooks(temp2).Worksheets("MYSHEET").Range("A1") .Paste Range("MYRANGE").Select Selection.SpecialCells(xlCellTypeVisible).Copy Application.Windows(temp2).Activate Workbooks(temp2).Worksheets(MYSHEET).Range("A1").P asteSpecial Paste:=xlPasteValues I apreciate any help. Thank you |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Bernie
"Bernie Deitrick" wrote: Ben, You need to actually paste the formatting: Range("MYRANGE").SpecialCells(xlCellTypeVisible).C opy 'Paste Values Workbooks(temp2).Worksheets(MYSHEET).Range("A1").P asteSpecial _ Paste:=xlPasteValues 'Paste FORMATS Workbooks(temp2).Worksheets(MYSHEET).Range("A1").P asteSpecial _ Paste:=xlPasteFormats HTH, Bernie MS Excel MVP "Ben" wrote in message ... Hi, I have a range name with few cell containing conditional formation, when I copy that range to an other workbook using code like this, the conditional formatting is not copied. Range("MYRANGE").Select Selection.SpecialCells(xlCellTypeVisible).Copy Application.Windows(temp2).Activate Workbooks(temp2).Worksheets("MYSHEET").Range("A1") .Paste Range("MYRANGE").Select Selection.SpecialCells(xlCellTypeVisible).Copy Application.Windows(temp2).Activate Workbooks(temp2).Worksheets(MYSHEET).Range("A1").P asteSpecial Paste:=xlPasteValues I apreciate any help. Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
code does not copy | Excel Discussion (Misc queries) | |||
copy and use vba code | New Users to Excel | |||
copy and use vba code | Excel Discussion (Misc queries) | |||
Help with COPY code | Excel Discussion (Misc queries) | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming |