Macro button's ON THE PAGE! (1 Viewer)

RichieP

Rock on!
Local time
Today, 20:14
Joined
Apr 16, 2003
Messages
48
Hello all you good good people!

What I need is a macro button actually on the page so the user can click it and it copies and pastes something that's already on the page. See attached example. What I need that button to do is copy the entire table and past it underneath the one that's already there with the macro button also moving down. More info on the attachment. Pretty cool if someone could get it to work!

Thanks
RichieP :)
 

Attachments

  • Char Spec forum example.doc
    72 KB · Views: 293

ghudson

Registered User.
Local time
Today, 16:14
Joined
Jun 8, 2002
Messages
6,195
Why are you using Word for this instead of Excel or Access?
 

RichieP

Rock on!
Local time
Today, 20:14
Joined
Apr 16, 2003
Messages
48
The people I'm doing it for want it in word :(
 
R

R0B073

Guest
Try creating a button with the following...

If you haven't already figured this out, trycreating a button with the following code. Worked for me, don't know howny times you might want to perform this on one page, the following copies the first table in your document...

Private Sub CommandButton1_Click()
' sacp Macro
' Macro recorded 6/5/2006 by R0B073

Selection.GoTo What:=wdGoToTable, Which:=wdGoToFirst, Count:=1, Name:=""
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Tables(1).Select
Selection.Copy
Selection.MoveDown Unit:=wdParagraph, Count:=1
Selection.TypeParagraph
Selection.Paste

End Sub
 

Users who are viewing this thread

Top Bottom