Thread: object required
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default object required

Also, the use of the Cells property requires a qualified sheet reference if
the code is not in a sheet code module. It is a good practice to always
qualify cells property to be sure the range object on the correct sheet is
acted upon.


\
"kyle" wrote in message
...

i copied this from a book. i run the macro and it says object required.
what's up?

Private Sub cmdinsertheading_click()
Cells(1, "d").Value = txtheading.Text
Cells(1, "d").Select

With Selection
.Font.Bold = True
.Font.Name = "arial"
.Font.Size = 72
.Font.Color = RGB(0, 0, 255)
.Columns.AutoFit
.Interior.Color = RGB(0, 255, 255)
.Borders.Weight = xlThick
.Borders.Color = RGB(0, 0, 255)
End With

txtheading.Activate

End Sub