Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
KN KN is offline
external usenet poster
 
Posts: 1
Default Macro to Paste Same Item a Specific Number of Times?

I have 4 paragraphs with specific wording. I would like to prompt the
user for the number of times they wish to copy and paste Paragraph 1,
Paragraph 2, etc. and then have the macro select, copy, and paste each
paragraph the specified number of times. I know I could manually copy
each paragraph to the clipboard and select each paragraph every time I
want to use that particular paragraph, but I'd like to find a more
elegant way to do this. Suggestions?

Thanks,
Kathy

  #2   Report Post  
Posted to microsoft.public.word.newusers
Cindy M -WordMVP- Cindy M  -WordMVP- is offline
external usenet poster
 
Posts: 370
Default Macro to Paste Same Item a Specific Number of Times?

Hi Kn,

I have 4 paragraphs with specific wording. I would like to prompt the
user for the number of times they wish to copy and paste Paragraph 1,
Paragraph 2, etc. and then have the macro select, copy, and paste each
paragraph the specified number of times. I know I could manually copy
each paragraph to the clipboard and select each paragraph every time I
want to use that particular paragraph, but I'd like to find a more
elegant way to do this.

Well, the basic way to get something to happen "n" times is:

For i = 1 to CLng(InputBox("How many times to repeat?))
'Put the code to repeat here
Next

Note that, as it stands, this isn't full-proof. It will fail if someone
doesn't type a number, for example. If you need more help with this, you
should ask in the word.vba.beginners newsgroup. This group is more for
end-user questions :-9

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
macro button Jack B Microsoft Word Help 5 July 26th 06 04:22 PM
Autonew macro in Word to select specific record from Excel database Peter Mailmerge 4 June 14th 06 05:39 PM
trying to copy & paste the same item multiple times on a page Mel Page Layout 1 May 12th 05 04:17 PM
how do you make a macro execute x number of times? ShelleyC Microsoft Word Help 1 March 14th 05 04:05 PM
Want to Repeat Records certain number of times davis Mailmerge 2 February 16th 05 09:21 PM


All times are GMT +1. The time now is 09:58 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"