Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
cells.Interior.ColorIndex = 1
activeworkbook.close SaveChanges:=False -- Regards, Tom Ogilvy "La Durande" wrote in message ... I wish to make make the background colour of all cells black prior to paste of an invoice details. I code upto now is as below but I need to add the background colur and then wish to close the workbook with code Range("A2:M73").Select Selection.Copy Workbooks.Add Range("A2").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=False Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=False Application.CutCopyMode = False Filesavename = Application.GetSaveAsFilename( _ fileFilter:="Excel Files (*.xls), *.xls") If Filesavename < False Then ActiveSheet.SaveAs Filename:=Filesavename, FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Doesn't seem to work and give error code 438
Object doesn't support this property or method "Tom Ogilvy" wrote: cells.Interior.ColorIndex = 1 activeworkbook.close SaveChanges:=False -- Regards, Tom Ogilvy "La Durande" wrote in message ... I wish to make make the background colour of all cells black prior to paste of an invoice details. I code upto now is as below but I need to add the background colur and then wish to close the workbook with code Range("A2:M73").Select Selection.Copy Workbooks.Add Range("A2").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=False Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=False Application.CutCopyMode = False Filesavename = Application.GetSaveAsFilename( _ fileFilter:="Excel Files (*.xls), *.xls") If Filesavename < False Then ActiveSheet.SaveAs Filename:=Filesavename, FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False End If End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works fine for me.
If you are using Excel 97 and doing it from a Commandbutton, then change the takefocusonclick property to False. -- Regards, Tom Ogilvy "La Durande" wrote in message ... Doesn't seem to work and give error code 438 Object doesn't support this property or method "Tom Ogilvy" wrote: cells.Interior.ColorIndex = 1 activeworkbook.close SaveChanges:=False -- Regards, Tom Ogilvy "La Durande" wrote in message ... I wish to make make the background colour of all cells black prior to paste of an invoice details. I code upto now is as below but I need to add the background colur and then wish to close the workbook with code Range("A2:M73").Select Selection.Copy Workbooks.Add Range("A2").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=False Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=False Application.CutCopyMode = False Filesavename = Application.GetSaveAsFilename( _ fileFilter:="Excel Files (*.xls), *.xls") If Filesavename < False Then ActiveSheet.SaveAs Filename:=Filesavename, FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change background colour | Excel Worksheet Functions | |||
Sheet Background Colour | Excel Discussion (Misc queries) | |||
change a cell background colour to my own RGB colour requirements | Excel Discussion (Misc queries) | |||
How to filter using background colour? | Excel Worksheet Functions | |||
Count if - background colour & value | Excel Programming |