From: kyle on

something still isn't right. i put this in the code

Set txtheading = Range("m17")

and what i type in m17 will appear in column d for a split second then
dissappear



"JLGWhiz" wrote:

> 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" <kyle(a)discussions.microsoft.com> wrote in message
> news:B02CFAA2-772A-42A8-A0A9-30E0FFC92AE2(a)microsoft.com...
> >
> > 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
>
>
> .
>
From: Jay on
Kyle -

After the procedure sets the value in D1, the combination of three things
scrolls the window and the entry seems to disappear (but it's still there).

1. ".Font.Size =72" makes the entry very large.
2. ".Columns.Autofit" widens the column to fit the large font.
3. "txtheading.Activate" forces cell D1 to scroll to the left (where you
can't see it).

So, rem out the statement txtheading.activate at the end and the procedure
should work, i.e., procede it with a single qoute ('txtheading.
Activate).
-----
Jay

"kyle" wrote:

>
> something still isn't right. i put this in the code
>
> Set txtheading = Range("m17")
>
> and what i type in m17 will appear in column d for a split second then
> dissappear
>
>
>
> "JLGWhiz" wrote:
>
> > 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" <kyle(a)discussions.microsoft.com> wrote in message
> > news:B02CFAA2-772A-42A8-A0A9-30E0FFC92AE2(a)microsoft.com...
> > >
> > > 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
> >
> >
> > .
> >