Re: Adding a column that has format

From: Steve L. (ssl_at_spamnosbcglobal.net)
Date: 03/13/04


Date: Sat, 13 Mar 2004 20:54:17 GMT

Thanks again Dave.
I'll try it again. I really appreciate your time.

"Dave Peterson" <ec35720@msn.com> wrote in message
news:40533FFA.42720C09@msn.com...
> Each post to the newsgroup is archived in google. If you explain in plain
text,
> then your post (and suggestions) will be kept there for people who may
need the
> same kind of solution.
>
> But google won't archive attachments and your pdf documents and web pages
are
> probably temporary and won't get archived either. So those
links/attachments
> won't help anyone who's searching later.
>
> And I try not to open attachments or click on links to other stuff. Lots
of bad
> stuff can happen and I'm not (usually) willing to take the risk--no matter
how
> small.
>
> That said, I clicked on your web link (bad Dave!).
>
> It looks like your headers are in Row 4. And you want to insert between
the
> last used column and the next to last used column.
>
> I don't see how the numbered heading and adding 1 fits in.
>
> But this might be closer to what you want.
>
> Option Explicit
> Sub testme01()
>
> Dim myCol As Long
>
> With Active***
> myCol = .Cells(4, .Columns.Count).End(xlToLeft).Column - 1
>
> If myCol = 1 Then
> MsgBox "I can't copy from the left of this column!"
> Exit Sub
> End If
>
> .Columns(myCol + 1).Insert
> .Columns(myCol).Copy
> .Columns(myCol + 1).PasteSpecial Paste:=xlPasteFormats, _
> Operation:=xlNone, SkipBlanks:=False, Transpose:=False
>
> .Cells(1, myCol + 1).Select
> End With
>
> Application.CutCopyMode = False
>
> End Sub
>
> Notice that the myCol (I renamed it from LastCol to match the existing
code) now
> uses:
> .cells(4,.columns.count).end(xltoleft).column -1
>
> That 4 means row 4.
> the .columns.count means 256, the .end(xltoleft) is like going to IV4 and
> hitting End, then left arrow.
>
> It'll take you to the last used cell in that row. Then I subtract to go
back
> one more.
>
> I dropped the stuff about adding 1 since I didn't see that in your page.
>
> If this is wrong, please take the time to describe what you want in plain
text.
>
> (I don't like breaking my rules <vbg>.)
>
> "Steve L." wrote:
> >
> > Dave Peterson <ec35720@msn.com> wrote in news:40530054.648A3483@msn.com:
> >
> > > I don't open attachments.
> > >
> >
> > OK, so I made it a regular .html page
> > Have a look?
> >
> > http://www.kraftworksremodel.com/Estimate%20vs%20actual.htm
> >
> > Thanks Dave.
> >
> > Someday the light bulb will power up above my head.
>
> --
>
> Dave Peterson
> ec35720@msn.com