Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting a colored row with the department name
This piece of code works in my macro however I need the interior color of the
row to be gray. I tried .interior.colorindex = gray after the insert and it did it but then stopped and I got an error. Also, the name of the department is in what is row 2, cell 17, but after the header row is inserted then it is now row 3. This name is the value of the row header. In this code it does not put the value in the row. I want it to be in the center of the row. Thanks very much for your help, ..Rows(2).Insert.Interior.ColorIndex = 15 With .Cells(3, 4) .Value = .Cells(3, 17) .Font.Bold = True .Font.Size = 14 .RowHeight = 18 .Font.Color = vbWhite End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting a colored row with the department name
Not quite sure what you are trying with : .Rows(2).Insert.Interior.ColorIndex
= 15 To get gray in row 2 use: ActiveSheet.Rows(2).Interior.ColorIndex = 15 To align text in the center horizontally, add this line of code in your With statment: .HorizontalAlignment = xlHAlignCenter "Janis" wrote: This piece of code works in my macro however I need the interior color of the row to be gray. I tried .interior.colorindex = gray after the insert and it did it but then stopped and I got an error. Also, the name of the department is in what is row 2, cell 17, but after the header row is inserted then it is now row 3. This name is the value of the row header. In this code it does not put the value in the row. I want it to be in the center of the row. Thanks very much for your help, .Rows(2).Insert.Interior.ColorIndex = 15 With .Cells(3, 4) .Value = .Cells(3, 17) .Font.Bold = True .Font.Size = 14 .RowHeight = 18 .Font.Color = vbWhite End With |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
inserting a colored row with the department name
thanks,
"JLGWhiz" wrote: Not quite sure what you are trying with : .Rows(2).Insert.Interior.ColorIndex = 15 To get gray in row 2 use: ActiveSheet.Rows(2).Interior.ColorIndex = 15 To align text in the center horizontally, add this line of code in your With statment: .HorizontalAlignment = xlHAlignCenter "Janis" wrote: This piece of code works in my macro however I need the interior color of the row to be gray. I tried .interior.colorindex = gray after the insert and it did it but then stopped and I got an error. Also, the name of the department is in what is row 2, cell 17, but after the header row is inserted then it is now row 3. This name is the value of the row header. In this code it does not put the value in the row. I want it to be in the center of the row. Thanks very much for your help, .Rows(2).Insert.Interior.ColorIndex = 15 With .Cells(3, 4) .Value = .Cells(3, 17) .Font.Bold = True .Font.Size = 14 .RowHeight = 18 .Font.Color = vbWhite End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automating Department Payroll | Excel Discussion (Misc queries) | |||
Add to a cell if a row has a date and a column has a department | Excel Programming | |||
Calculating Working Days - Department of Pathology | Excel Discussion (Misc queries) | |||
How to use Macro throughout Department | Excel Programming | |||
Cell right next to colored cells is automatically colored on entering a value | Excel Programming |