Merging heasders for Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Would someone tell me how to merge my headers in my Excel spreadsheet
The first header: "Media Movement Office Year to Date Totals for " &
Year(Me.dteInput) begins in cell A1 and ends in cell D1

The second header:"Run Date: " & Date begins in row 2 cell A1 needs to
be centered as does the first header.

With wks
.Cells(1, 1).Value = "Media Movement Office Year to Date Totals for " &
Year(Me.dteInput)
.Cells(1, 1).ColumnWidth = 24
.Cells(2, 1).Value = "Run Date: " & Date
.Cells(4, 3).Value = "Jan"
.Cells(4, 4).Value = "Feb"
.Cells(4, 5).Value = "Mar"
.Cells(4, 6).Value = "Apr"
.Cells(4, 7).Value = "May"
.Cells(4, 8).Value = "Jun"
.Cells(4, 9).Value = "Jul"
.Cells(4, 10).Value = "Aug"
.Cells(4, 11).Value = "Sep"
.Cells(4, 12).Value = "Oct"
.Cells(4, 13).Value = "Nov"
.Cells(4, 14).Value = "Dec"
.Cells(6, 1).Value = "Errant MMO Delivery"
.Cells(7, 1).Value = "Vendor Consulted"
.Cells(8, 1).Value = "Internal Consultations"
.Cells(9, 1).Value = "Pieces Moved"
.Cells(10, 1).Value = "Units Moved"
.Cells(11, 1).Value = "Concerns and Issues"
.Cells(12, 1).Value = "Total MMO Cases"
.Cells(13, 1).Value = "Closed Moves"
.Cells(14, 1).Value = "Pending Moves"
.Cells(16, 1).Value = "Grand Total MMO Cases"
End With
 
this newsgroup is devoted to questions re MS Access relational database
software. unless you're trying to merge the spreadsheet headers from within
Access, suggest you post your question to an Excel newsgroup.
 
Hi John
I got the merge to work,using .Range(.Cells(1,1), .Cells(1,4)).Merge,but now
I can't get the header to center. I am using .HorizontalAlignment = 'xlcenter
right afterwards.
 
This works for me:
Range("A1:D1").Merge
Range("A1:D1").HorizontalAlignment = xlCenter
Range("A1:D1").Value = "This is a test"

But as Tina says, if you want expert help with Excel you need to ask in
an Excel group.
 
Sorry Tina,I was coding in Access,so thought I could ask the questions in
the Access forum.
 
Thanks again John
I thought sense I was coding in Access I could ask the question in this forum.
 
a lot of people post to the Access newsgroups by mistake, when they're
working exclusively in other software. i was not sure if you had mistakenly
posted here, rather than an Excel newsgroup. that's why i answered with the
caveat
unless you're trying to merge the spreadsheet headers from within Access

now that it's clear you *are* trying to manipulate an Excel file from within
Access, John will probably be able to help you. good luck with it. :)

hth
 
Back
Top