Inserting column headers

S

Steve

How would I write a macro that:

i)Inserts a new row in row 1 of my spreadsheet
ii)Places columns names in A1 ("Surname"),B1 ("First
Name") & C1 ("Score") and Bolds them.

Thanks in advance
 
R

Ron de Bruin

Try this

Sub test()
With ActiveSheet
.Range("A1").EntireRow.Insert
.Range("A1").Value = "Surname"
.Range("B1").Value = "First Name"
.Range("C1").Value = "Score"
.Range("A1:C1").Font.Bold = True
End With
End Sub
 
T

Tom Ogilvy

rows(1).Insert
Range("A1:C1").Value = Array("Surname","First Name","Score")
Range("A1:C1").font.bold = True
 

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

Top