Formatting using VBA

  • Thread starter Thread starter Deville
  • Start date Start date
D

Deville

Hello All,
I am dumping data from an Ms Access data source to an
Excel spreadsheet. I have the field names and the data
going to excel just fine. I having trouble mimicking a
Header section from a picture of what my users want to
see. How can I:
1: Insert a into a cell and have the cell cover from A1
to say D1
2: Format that area with Highlight, bold, shading all
that good stuff.

If anyone could help me with that, it would really be
appreciated.
 
Let me try that again..

Sub URSUB()
Range("A1:D1").Select
Selection.Font.Bold = True
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End Sub
 
Deville said:
Hello All,
I am dumping data from an Ms Access data source to an
Excel spreadsheet. I have the field names and the data
going to excel just fine. I having trouble mimicking a
Header section from a picture of what my users want to
see. How can I:
1: Insert a into a cell and have the cell cover from A1
to say D1
2: Format that area with Highlight, bold, shading all
that good stuff.

If anyone could help me with that, it would really be
appreciated.

In addition to what Alex said, playing with Excel's Macro Recorder feature
can show you the right code. It also shows you a lot of format code you
don't need, but it's a great way to learn how to code cell formats.

-gk-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top