Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Center the Column Headers
I have values in Cells A1, B1 and C1 in a new sheet. How can I align them to
center? I have tried the following: NewSheet.Rows(1).align msoAlignCenter, true Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Center the Column Headers
Fo just A1:C1
Range("A1:C1").HorizontalAlignment = xlCenter For the whole first row Rows(1).HorizontalAlignment = xlCenter AccessHelp wrote: I have values in Cells A1, B1 and C1 in a new sheet. How can I align them to center? I have tried the following: NewSheet.Rows(1).align msoAlignCenter, true Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Center the Column Headers
Did you try recording a macro while doing it manually
-- Don Guillett Microsoft MVP Excel SalesAid Software "AccessHelp" wrote in message ... I have values in Cells A1, B1 and C1 in a new sheet. How can I align them to center? I have tried the following: NewSheet.Rows(1).align msoAlignCenter, true Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Center the Column Headers
JW,
Thanks for your help. The code works perfectly. "JW" wrote: Fo just A1:C1 Range("A1:C1").HorizontalAlignment = xlCenter For the whole first row Rows(1).HorizontalAlignment = xlCenter AccessHelp wrote: I have values in Cells A1, B1 and C1 in a new sheet. How can I align them to center? I have tried the following: NewSheet.Rows(1).align msoAlignCenter, true Thanks. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Center the Column Headers
Thanks for your response. No, I didn't record the macro. I wrote the code
from scratch, and this line item is just a portion of my entire code. One of the challenges that I have is I am still new to Excel syntax. Thanks. "Don Guillett" wrote: Did you try recording a macro while doing it manually -- Don Guillett Microsoft MVP Excel SalesAid Software "AccessHelp" wrote in message ... I have values in Cells A1, B1 and C1 in a new sheet. How can I align them to center? I have tried the following: NewSheet.Rows(1).align msoAlignCenter, true Thanks. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Center the Column Headers
Hi Ryan,
Thanks for your response. As I mentioned to Don below, this line item is just a portion of my entire code. Plus, I am still new to Excel syntax. Thanks. " wrote: On Oct 15, 9:33 am, JW wrote: Fo just A1:C1 Range("A1:C1").HorizontalAlignment = xlCenter For the whole first row Rows(1).HorizontalAlignment = xlCenter AccessHelp wrote: I have values in Cells A1, B1 and C1 in a new sheet. How can I align them to center? I have tried the following: NewSheet.Rows(1).align msoAlignCenter, true Thanks. Record a macro, then highlight the columns you want to center than use the center align button then stop macro. It's good to use the record macro for simple tasks such as this; this way you can get a basic understanding about vba. ryan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
lookup using column headers and row headers | Excel Discussion (Misc queries) | |||
Merge and Center and Center Accross Selection | New Users to Excel | |||
Macro code to center pasted data in a column | Excel Discussion (Misc queries) | |||
Hide Column Headers but not row (Headers) | Excel Programming | |||
Loop through column headers to search from column name and get cell range | Excel Programming |